Skip to content

Azure App Service Settings #21

Azure App Service Settings

Azure App Service Settings #21

# https://github.com/marketplace/actions/azure-app-service-settings
name: Azure App Service Settings
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
apply-azure-app-service-settings:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Set current datetime as env variable
env:
TZ: 'Asia/Tokyo'
run: echo "CURRENT_DATETIME=$(date +'%Y-%m-%d_%H:%M:%S')" >> $GITHUB_ENV
- name: Az CLI Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Azure App Service Settings
uses: Azure/appservice-settings@v1
with:
app-name: ${{ vars.AZURE_WEBAPP_NAME }}
slot-name: 'Production'
app-settings-json: '{"name":"now","value":"${{ env.CURRENT_DATETIME }}","slotSetting":false}'
general-settings-json: '${{ vars.AZURE_WEBAPP_GENERAL_SETTINGS }}'
- name: Az CLI Logout
run: az logout