-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (35 loc) · 1.01 KB
/
restart-service.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 }}