"Deployments fail — that's normal. What separates smooth teams is knowing how to read the error and fix it fast."
Level: Beginner · Time: ~2 days · Prerequisites: Modules 8, 16
Learning Objectives
By the end of this module, you will be able to:
- Diagnose common azd deployment failures
- Use logs and verbose output to find causes
- Fix provisioning vs deployment errors
- Debug AI-specific issues
1. A Calm Approach to Errors
A failed azd up isn't a disaster — it's information. Deployments touch many systems — your code, Azure's APIs, quotas, networks — so some friction is normal even for experts. The trick is to read the actual error message, identify whether it's a provisioning or deployment problem, and fix that specific thing. Panic and random retries waste time; reading the message solves it. Azure output can be verbose, but the useful part is usually a short code and one sentence near the top — scroll up to the first failure, not the last.
Concept: Almost every deploy error names its cause — a missing quota, a bad region, an auth issue, a build failure. The fix is usually in the first error line you skipped past.
2. Provisioning vs Deployment Failures
Where in the azd up sequence it broke tells you where to look — provisioning runs first (creating Azure resources), then deployment (building and pushing your code):
| Failure during… | Usual causes |
|---|---|
provision | Quota exceeded, region/model unavailable, invalid Bicep, permissions |
deploy | Build error, wrong port/config, container fails to start |
Try this: Next time a deploy fails, first ask "did it fail while creating resources, or while pushing my code?" That single question halves the search space instantly.
3. Turn On the Detail
When the message isn't enough, ask azd for more:
azd up --debugThe --debug flag prints verbose logs showing exactly what azd ran, which Azure calls it made, and where it stopped. Redirect it to a file (azd up --debug > deploy.log 2>&1) when the output scrolls past your terminal's buffer. For app-level issues — the deploy succeeded but the app misbehaves — the error won't be in azd at all: check the host's logs (Container Apps / App Service logs) or your Application Insights exceptions (Module 16).
Common mistake: Re-running azd up unchanged, hoping it works this time. If nothing changed, nothing will. Read the debug output, fix the named cause, then re-run.
4. Common Fixes
A handful of issues cover the large majority of failures — work down this list before assuming anything exotic:
- Not logged in / wrong subscription →
azd auth login, checkazd env. - Quota exceeded → request more, or lower the SKU/capacity (Module 15).
- Region/model unavailable → pick a supported region.
- App won't start → check it reads the right port and env vars (Module 6).
When none of these fit, widen the net: copy the exact error code into the azd or Azure docs — someone has almost certainly hit it before, and the fix is often one setting away.
Real-world use case: A deploy fails at provision with "quota exceeded" for an AI model. The developer reads it, lowers the capacity value, re-runs azd provision, and it succeeds — a 90-second fix once they read the message.
5. Debugging AI Apps
AI apps add their own puzzles: a model returns errors (check the deployment name and endpoint), responses are slow or throttled (check capacity/TPM from Module 15), or answers are wrong (check the prompt, the data, and whether RAG retrieved anything at all). A 404 usually means the deployment name is misspelled; a 429 means you've hit your token quota. Application Insights and the Foundry portal are your windows into these.
Concept: For AI issues, separate infrastructure problems (the model isn't reachable) from quality problems (it's reachable but the answer is bad). They live in different places and have different fixes.
✅ Checkpoint
- What's the first thing to do when a deploy fails?
- How do you tell a provisioning failure from a deployment failure?
- What flag makes azd print verbose logs?
Answers: 1) Read the actual error message and identify the specific cause. 2) Ask whether it failed while creating resources (provision) or pushing code (deploy). 3) --debug.
Key Takeaway: Troubleshooting azd is methodical, not magical: read the error, decide whether it's a provision (quota, region, Bicep, permissions) or deploy (build, config, startup) failure, and use azd up --debug plus host and Application Insights logs to pinpoint it. Fix the named cause before re-running. For AI apps, separate infrastructure problems from answer-quality problems.
Further Learning
Part of "AZD for Beginners." Adapted from Microsoft's open AZD curriculum (MIT License).