| name | azure-deployment |
| description | Deploys the application to Azure using azd and Terraform. Use when deploying, provisioning cloud resources, running azd provision, azd deploy, or setting up Azure infrastructure. |
| argument-hint | Specify target environment or any custom Terraform variables |
Purpose
Exact step-by-step commands for deploying the full stack to Azure using azd + Terraform.
When to Use
- First-time deployment to Azure.
- Redeploying after code changes.
- Provisioning infrastructure with Terraform.
Prerequisites
- Azure CLI installed and signed in:
az login
- Azure Developer CLI installed:
azd auth login
- Docker installed (for container image builds)
Flow
-
Configure environment:
cp .env.azure.example .env.azure
-
Set Terraform variables:
cp infra/main.tfvars.example infra/main.tfvars
-
Provision infrastructure:
azd provision
This runs Terraform to create: Resource Group, Managed Identity, ACR, Container App Environment, backend + frontend Container Apps, and optionally Cosmos DB and Key Vault.
Post-provision script (infra/scripts/postprovision.sh) runs automatically.
-
Deploy application:
azd deploy
Builds and deploys backend + frontend container images to Container Apps.
-
Verify deployment:
curl https://<backend-url>/healthz
open https://<frontend-url>
cd infra && terraform output
-
Update existing deployment:
azd deploy
azd provision
Troubleshooting
- Auth error: Run
az login and azd auth login again.
- Terraform state: Check
infra/backend.tf for state backend config.
- Container build fails: Verify Dockerfiles in
py/apps/app-template/ and ts/apps/ui-copilot-template/.
- Cosmos connection: Verify managed identity has
Cosmos DB Data Contributor role.
Checklist