Skill 45 · Azure Architecture Autopilot
Subchapter 45.6
references/bicep-reviewer.mdMarkdown7 KBView on GitHub
Reviews generated Bicep code and automatically fixes any issues found.
Scripts
CLIAlso bundled
GitignoreRun actual Bicep compilation before the checklist. Do not declare “pass” based on visual inspection alone.
az bicep build --file main.bicep 2>&1Collect all WARNINGs and ERRORs from the compilation results. This is the foundational data for the review.
Fix issues found in compilation results:
🚨 WARNING Handling Criteria — Do Not Force Unnecessary Fixes:
WARNINGs do not block deployment. Attempting to resolve warnings often introduces deployment errors, so use the following criteria:
| WARNING Type | Action | Reason |
|---|---|---|
| BCP081 (type not defined) | Leave as-is (if API version is the latest confirmed from MS Docs) | Local Bicep CLI type definitions are not yet updated. No impact on deployment |
| BCP035 (missing property) | Judge carefully — Check MS Docs to verify if the property is actually required; if not, leave as-is | Adding properties can cause deployment failures due to compatibility issues (e.g., computeMode) |
| BCP187 (sku/kind type unverified) | Leave as-is | Values confirmed from MS Docs will work correctly at deployment |
| no-hardcoded-env-urls | Leave as-is | DNS Zone names inevitably require hardcoding |
Never do the following:
Principle: Document WARNINGs in review results, but do not fix them if they don’t block deployment.
Common issues and responses:
Review the following items after compilation passes. See references/service-gotchas.md for full gotchas.
customSubDomainName setting exists — Cannot be changed after creation; if missing, resource must be deleted and recreatedaccounts/projects) must exist — Portal access unavailable without itidentity: { type: 'SystemAssigned' } — Project creation fails without itpublicNetworkAccess: 'Disabled' — All services using PEisHnsEnabled: true — Without it, becomes regular Blob StorageprivateEndpointNetworkPolicies: 'Disabled' — PE creation fails without itenablePurgeProtection: trueallowBlobPublicAccess: false, minimumTlsVersion: 'TLS1_2'registrationEnabled: falsereferences/ai-data.md or MS DocsdependsOn)uniqueString()Verify the following items are not hardcoded as literal values in the Bicep code:
location — Literal region names ('eastus', 'koreacentral', etc.) are not used directly; passed via param locationThis is not directly within this review’s scope, but if specific API versions, SKU lists, or region lists are hardcoded in code comments or parameter descriptions, remove them and replace with “Check MS Docs” guidance.
kind: 'OpenAI' is used instead of Foundry → Change to kind: 'AIServices' unless the user explicitly requested itMachineLearningServices) is used for general AI/RAG → Change to Foundry unless the user explicitly requested itIf any changes were made in Steps 2–4, run az bicep build again to verify no new errors were introduced.
Compilation only validates syntax and types. The following items cannot be caught by compilation and are finally verified in Phase 4’s az deployment group what-if:
State these limitations in the review results so the user understands the importance of the what-if step.
## Bicep Code Review Results
**Compilation Result**: [PASS/WARNING N items]
**Checklist**: ✅ Passed X items / ⚠️ Warnings X items
**Hardcoding Check**: [PASS / N violations]
**Auto-fixed**: X items
### Compilation Warnings (Remaining)
- [Warning content — including reason why it cannot be fixed]
### Auto-fix Details
- [File:line number] Before → After (reason)
### Hardcoding Violations (If Any)
- [File:line number] [Violation details] → [Fix method]
**Conclusion**: [Ready for deployment / Manual review required]When asking whether to proceed to Phase 4 after passing code review, always include a message to reassure the user. Users may feel uneasy about the word “deployment”, so clearly communicate that what-if is a safe validation step.
ask_user({
question: "Code review passed! Ready to proceed to the next step?\n\n⚡ This does NOT deploy immediately:\n 1️⃣ What-if validation — Simulates what will be created (not a deployment, safe)\n 2️⃣ Preview diagram — Review the architecture to be deployed as a diagram\n 3️⃣ Final confirmation — Actual deployment only after you review the diagram and approve\n\nNothing will be deployed without your approval.",
choices: [
"Proceed to next step (what-if validation + preview diagram) (Recommended)",
"Just give me the code, I'll deploy later"
]
})Key points: