Code description
GitHub Actions provides action azure/container-apps-deploy-action
to deploy built container into Azure Container Apps. This action's attribute environmentVariables
can be used to replace the existing variables. If you only want to update some variables, we can use Azure CLI commands.
References
https://github.com/Azure/container-apps-deploy-action
Code snippet
jobs:
update-container-app:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# Update environment variable
- name: Update container app environment variables
uses: azure/CLI@v1
with:
inlineScript: |
az config set extension.use_dynamic_install=yes_without_prompt
az containerapp update -n MyApp -g MyResourceGroup --set-env-vars "VAR1=Value1"