This Action for Azure enables arbitrary actions for interacting with Azure services via the az command-line client.
The workflow below will deploy a custom Docker image to Azure Web App for Containers, and assumes the pre-existence of:
- An Azure service principal (more info)
- An Azure resource group, created with
az group create --name $RESOURCE_GROUP --location $LOCATION - 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"
}
}AZURE_SERVICE_APP_ID- Required TheappIdof your service principal (more info)AZURE_SERVICE_TENANT– Required Thetenantof your service principal (more info)AZURE_SERVICE_PASSWORD- Optional Thepasswordof your service principal, required for password-based authentication (more info)AZURE_SERVICE_PEM– Optional The PEM public string for the certificate of your service principal, required for certificate-based authentication (more info)
AZ_OUTPUT_FORMAT- Optional Theazcli output format, defaults to JSON (more info)
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.