Performs comprehensive preflight validation of Bicep deployments to Azure, including template syntax validation, what-if analysis, and permission checks. Use this skill before any deployment to Azure to preview changes, identify potential issues, and ensure the deployment will succeed. Activate when users mention deploying to Azure, validating Bicep files, checking deployment permissions, previewing infrastructure changes, running what-if, or preparing for azd provision.
Validates Bicep deployments before execution, supporting both Azure CLI (az) and Azure Developer CLI (azd) workflows.
azd up, azd provision, or az deployment commandsFollow these steps in order. Continue even if a previous step fails — capture all issues in the final report.
Check for azd project: Look for azure.yaml in the project root
Locate Bicep files: Find all .bicep files
infra/ directory firstinfra/, deploy/, project rootAuto-detect parameter files:
<filename>.bicepparam (preferred)<filename>.parameters.jsonbicep build <bicep-file> --stdout
Capture syntax errors with line/column numbers and warnings.
For azd Projects:
azd provision --preview
azd provision --preview --environment <env-name>
For Standalone Bicep (scope from targetScope declaration):
# Resource Group (default)
az deployment group what-if \
--resource-group <rg-name> \
--template-file <bicep-file> \
--parameters <param-file> \
--validation-level Provider
# Subscription scope
az deployment sub what-if \
--location <location> \
--template-file <bicep-file> \
--validation-level Provider
Fallback (if RBAC permission errors):
az deployment group what-if \
--resource-group <rg-name> \
--template-file <bicep-file> \
--validation-level ProviderNoRbac
| Symbol | Change Type | Meaning |
|---|---|---|
+ | Create | New resource will be created |
- | Delete | Resource will be deleted |
~ | Modify | Resource properties will change |
= | NoChange | Resource unchanged |
! | Deploy | Changes unknown |
Create preflight-report.md in the project root with:
| Error Type | Action |
|---|---|
| Not logged in | Suggest az login or azd auth login |
| Permission denied | Fall back to ProviderNoRbac, note in report |
| Bicep syntax error | Include all errors, continue |
| Tool not installed | Note in report, skip that step |
| Resource group not found | Suggest creating it |
az --version # Azure CLI 2.76.0+ recommended
azd version # For azd projects
bicep --version # For syntax validation