Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Deploy applications and infrastructure to Azure using Copilot-guided workflows and Azure MCP
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/recipes/azd/README.md
1# AZD Deploy Recipe23Deploy to Azure using Azure Developer CLI (azd).45> 💡 **Note:** azd supports both Bicep and Terraform as IaC providers. The deployment workflow is identical regardless of which you use.67## Prerequisites89- `azd` CLI installed → Run `mcp_azure_mcp_extension_cli_install` with `cli-type: azd` if needed10- `.azure/deployment-plan.md` exists with status `Validated`11- `azure.yaml` exists and validated12- Infrastructure files exist (Bicep: `infra/main.bicep`, Terraform: `infra/*.tf`)13- **AZD environment configured** → Done in azure-validate14- **Subscription and location confirmed** → See [Pre-deploy Checklist](../../pre-deploy-checklist.md)1516## Workflow1718| Step | Task | Command |19|------|------|---------|20| 1 | **Verify environment** | `azd env get-values` — Confirm AZURE_SUBSCRIPTION_ID and AZURE_LOCATION set |21| 2 | **Provision infrastructure** | `azd provision --no-prompt` |22| 3 | **RBAC health check** *(Container Apps + ACR only)* | After provisioning, verify `AcrPull` role has propagated before deploying — see [Pre-Deploy Checklist](../../pre-deploy-checklist.md#container-apps--acr--pre-deploy-rbac-health-check) |23| 4 | **Deploy application** | `azd deploy --no-prompt` |24| 5 | **Post-Deploy** | [Post-Deployment Steps](post-deployment.md) — If using SQL + managed identity |25| 6 | **Verify** | See [Verification](verify.md) |26| 7 | **Report** | Present deployed endpoint URLs to the user — see [Verification](verify.md) Step 3 |2728> ⚠️ **Important:** For Container Apps that use a managed identity to pull from ACR, always run `azd provision` and `azd deploy` as **separate steps** (not `azd up`) and complete the RBAC health check between them. This ensures the managed identity `AcrPull` role assignment has propagated before the Container App revision attempts to pull the image.2930> ⚠️ **Important:** For .NET Aspire projects or projects using azd "limited mode" (no explicit `infra/` folder), verify that `azd provision` populated all required environment variables. If `azd deploy` fails with errors about missing `AZURE_CONTAINER_REGISTRY_ENDPOINT`, `AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID`, or `MANAGED_IDENTITY_CLIENT_ID`, see [Error Handling](errors.md#missing-container-registry-variables) for the resolution.3132## Common Mistakes3334| ❌ Wrong | Why It Fails |35|----------|-------------|36| `azd up --location eastus2` | `--location` is not a valid flag for `azd up` |37| `azd up` without `azd env new` | Prompts for input, fails with `--no-prompt` |38| `mkdir .azure` then `azd env new --no-prompt` | Creates env folder structure incorrectly |39| Setting AZURE_LOCATION without checking RG | "Invalid resource group location" if RG exists elsewhere |40| Ignoring `azd-service-name` tag conflicts in same RG | "found '2' resources tagged with..." error |41| `language: html` or `language: static` | Not valid - use `language: js` with `dist: .` for static sites |4243## Deployment Commands4445> ⚠️ `azd up` takes 5-15 min. Run with output **streamed visibly to the user** — do NOT run silently or suppress output. The user must see provisioning progress in real time.4647### Full Deployment4849Provisions infrastructure AND deploys application:5051```bash52azd up --no-prompt53```5455### Infrastructure Only5657```bash58azd provision --no-prompt59```6061### Application Only6263Deploy code to existing infrastructure:6465```bash66azd deploy --no-prompt67```6869### Single Service7071```bash72azd deploy api --no-prompt73```7475## References7677- [Pre-deploy Checklist](../../pre-deploy-checklist.md) — **REQUIRED**78- [Post-Deployment Steps](post-deployment.md) — SQL + managed identity setup79- [Azure Functions Deployment](functions-deploy.md)80- [Verification](verify.md)81- [Error Handling](errors.md)82