GitHub Action for interacting with Azure
Clone or download
anthonysterling Merge pull request #3 from actions/update-readme-usage-prereqs
Clarify Docker container image pre-requisite
Latest commit 19d0971 Jan 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Initial commit Oct 16, 2018
script Initial commit Oct 16, 2018
test Initial commit Oct 16, 2018
.dockerignore Initial commit Oct 16, 2018
Brewfile Initial commit Oct 16, 2018
Dockerfile Fix icon name Dec 18, 2018
LICENSE Initial commit Oct 16, 2018
README.md Clarify Docker container image pre-requisite Dec 18, 2018
THIRD_PARTY_NOTICE.md Initial commit Oct 16, 2018
entrypoint.sh Initial commit Oct 16, 2018

README.md

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.