Azure App Service Settings #18
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
# 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: Dump context | |
run: echo "${{ toJSON(github) }}" | |
- name: Set current datetime as env variable | |
env: | |
TZ: 'Asia/Tokyo' | |
run: | | |
CURRENT_DATETIME=$(date +'%Y-%m-%d_%H:%M:%S') | |
SETTINGS=$(echo "${{ vars.AZURE_WEBAPP_APP_SETTINGS }}" | sed "s/{0}/$CURRENT_DATETIME/") | |
echo "SETTINGS='$SETTINGS'" >> $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: '${{ env.SETTINGS }}' | |
general-settings-json: '${{ vars.AZURE_WEBAPP_GENERAL_SETTINGS }}' | |
- name: Az CLI Logout | |
run: az logout |