Kontext Kontext

GitHub Actions: Update Azure Container Apps Environment Variables

event 2023-05-10 visibility 493 comment 0 insights
more_vert
insights Stats

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"
More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts