Skip to content
/ azure Public
forked from mopig/azure

GitHub Action for interacting with Azure

License

Notifications You must be signed in to change notification settings

Anumita/azure

 
 

Repository files navigation

GitHub Actions for Azure

This Action for Azure enables arbitrary actions for interacting with Azure services via the az command-line client.

Usage

The workflow below mimics this Web App for Containers tutorial, deploying an existing Docker image to Azure Web App for Containers. In addition to an existing Docker image, it assumes the pre-existence of:

  1. An Azure service principal (more info)
  2. An Azure resource group, created with az group create --name $RESOURCE_GROUP --location $LOCATION
  3. An Azure app service plan, created with az appservice plan create --name $APP_SERVICE_PLAN --resource-group $RESOURCE_GROUP --sku B1 --is-linux
workflow "Deploy to Azure Web App for Containers" {
  on = "push"
  resolves = ["Deploy Webapp"]
}

action "Deploy Webapp" {
  uses = "actions/azure@master"
  args = "webapp create --resource-group $RESOURCE_GROUP --plan $APP_SERVICE_PLAN --name $WEBAPP_NAME --deployment-container-image-name $CONTAINER_IMAGE_NAME"
  secrets = ["AZURE_SERVICE_APP_ID", "AZURE_SERVICE_PASSWORD", "AZURE_SERVICE_TENANT"]
  env = {
    APP_SERVICE_PLAN = "myAppServicePlan"
    CONTAINER_IMAGE_NAME = "owner/repo:tag"
    RESOURCE_GROUP = "myLinuxResourceGroup"
    WEBAPP_NAME = "myWebApp"
  }
}

Secrets

  • AZURE_SERVICE_APP_ID - Required The appId of your service principal (more info)
  • AZURE_SERVICE_TENANTRequired The tenant of your service principal (more info)
  • AZURE_SERVICE_PASSWORD - Optional The password of your service principal, required for password-based authentication (more info)
  • AZURE_SERVICE_PEMOptional The PEM public string for the certificate of your service principal, required for certificate-based authentication (more info)

Environment variables

  • AZ_OUTPUT_FORMAT - Optional The az cli output format, defaults to JSON (more info)

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

Container images built with this project include third party materials. See THIRD_PARTY_NOTICE.md for details.

About

GitHub Action for interacting with Azure

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 53.3%
  • HCL 25.8%
  • Dockerfile 20.1%
  • Ruby 0.8%