Restart Service - development #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run-name: 'Restart Service - ${{inputs.environment}}' | |
name: 'Restart Service' | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Azure deployment environment' | |
required: true | |
default: 'development' | |
type: choice | |
options: | |
- development | |
- staging | |
- production | |
jobs: | |
restart-service: | |
name: Restart | |
runs-on: ubuntu-22.04 | |
environment: ${{ inputs.environment }} | |
# Permissions for OIDC authentication | |
permissions: | |
id-token: write | |
contents: write | |
issues: write | |
steps: | |
# Login to Azure using OIDC | |
- name: Login to Azure CLI | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Restart Service | |
run: | | |
az webapp restart --resource-group ${{ vars.RESOURCE_NAME_PREFIX }}-rg --name ${{ vars.WEBAPP_NAME }} |