This script will walk you through the deployment of Azure Container Apps using Terraform configuration file.
The terraform config in main.tf
file will create the following resources:
- Resource group
- Azure Container Apps Environment
- Azure Container Apps that deploys the container image from ACR registry:
exampleacr.azurecr.io/exampleimage:latest
.
To deploy this config, you need to cd into the folder where you have the main.tf
file. Then run the following commands.
terraform init
terraform plan -out tfplan
terraform apply tfplan
This template provides a way to deploy a Container App in a Container App Environment. You need to create a resource group. Then you run the following commands to create the following resources:
- Log Analytics workspace
- Container Apps Environment
- Container Apps container using a docker image from ACR registry
$RESOURCE_GROUP="rg-aca-app-bicep"
# create new resource group
az group create --name $RESOURCE_GROUP --location uksouth
# preview the changes
az deployment group what-if `
--name aca-demo-bicep `
--resource-group $RESOURCE_GROUP `
--template-file main.bicep
# apply the changes
az deployment group create `
--name aca-demo-bicep `
--resource-group $RESOURCE_GROUP `
--template-file main.bicep