Skip to content
Enable GitHub developers to deploy to Azure WebApp for containers using GitHub Actions
TypeScript JavaScript
Branch: master
Clone or download

Latest commit


Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Adding CI Mar 28, 2020
lib updating package Dec 10, 2019
src Adding CI Mar 28, 2020
.gitignore Adding CI Mar 28, 2020
.nycrc Adding CI Mar 28, 2020 Initial commit Sep 19, 2019
LICENSE Initial commit Sep 19, 2019 Update Mar 26, 2020 Initial commit Sep 19, 2019
action.yml updating package Dec 10, 2019
package-lock.json Adding CI Mar 28, 2020
package.json Adding CI Mar 28, 2020
tsconfig.json Adding CI Mar 28, 2020

GitHub Action for deploying to Azure Web App for Containers

GitHub Actions gives you the flexibility to build an automated software development lifecycle workflow.

You can automate your workflows to deploy Azure Web Apps for Containers using GitHub Actions.

Get started today with a free Azure account!

This repository contains GitHub Action for Azure WebApp for containers to deploy to Azure WebApp for Containers. Supports deploying a single container image or multiple containers.

If you are looking for a Github Action to deploy to an Azure WebApp (Windows or Linux), consider using Azure WebApp action.

For deploying container images to Kubernetes, consider using Kubernetes deploy action. This action requires that the cluster context be set earlier in the workflow by using either the Azure/aks-set-context action or the Azure/k8s-set-context action.

The definition of this Github Action is in action.yml.

End-to-End Sample Workflows

Dependencies on other Github Actions

  • Checkout Checkout your Git repository content into Github Actions agent.
  • Azure Login Login with your Azure credentials for Web app deployment authentication. Once login is done, the next set of Azure actions in the workflow can re-use the same session within the job.
  • docker-login : Actions to log in to a private container registry such as Azure Container registry. Once login is done, the next set of Actions in the workflow can perform tasks such as building, tagging and pushing containers.

Azure Service Principle for RBAC

For using any credentials like Azure Service Principal in your workflow, add them as secrets in the GitHub repository and then refer them in the workflow.

  1. Download Azure CLI from here, run az login to login with your Azure credentials.
  2. Run Azure CLI command to create an Azure Service Principal for RBAC:
   az ad sp create-for-rbac --name "myApp" --role contributor \
                            --scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group} \
  # Replace {subscription-id}, {resource-group} with the subscription, resource group details of the WebApp
  # The command should output a JSON object similar to this:

    "clientId": "<GUID>",
    "clientSecret": "<GUID>",
    "subscriptionId": "<GUID>",
    "tenantId": "<GUID>",
  • You can further scope down the Azure Credentials to the Web App using scope attribute. For example,
 az ad sp create-for-rbac --name "myApp" --role contributor \
                          --scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Web/sites/{app-name} \

# Replace {subscription-id}, {resource-group}, and {app-name} with the names of your subscription, resource group, and Azure Web App.
  1. Paste the json response from above Azure CLI to your Github Repository > Settings > Secrets > Add a new secret > AZURE_CREDENTIALS
  2. Now in the workflow file in your branch: .github/workflows/workflow.yml replace the secret in Azure login action with your secret (Refer to the example below)

Build and deploy a Node.js app to Azure WebApp Container

on: [push]

name: Linux_Container_Node_Workflow

    runs-on: ubuntu-latest
    # checkout the repo
    - name: 'Checkout Github Action' 
      uses: actions/checkout@master
    - name: 'Login via Azure CLI'
      uses: azure/login@v1
        creds: ${{ secrets.AZURE_CREDENTIALS }}
    - uses: azure/docker-login@v1
        username: ${{ secrets.REGISTRY_USERNAME }}
        password: ${{ secrets.REGISTRY_PASSWORD }}
    - run: |
        docker build . -t${{ github.sha }}
        docker push${{ github.sha }} 
    - uses: azure/webapps-container-deploy@v1
        app-name: 'node-rnc'
        images: '${{ github.sha }}'
    - name: Azure logout
      run: |
        az logout


This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.

You can’t perform that action at this time.