Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Validate Azure configurations, ARM/Bicep templates, and resource settings before deployment
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/recipes/bicep/README.md
1# Bicep Validation23Validation steps for standalone Bicep deployments.45## Prerequisites67- `./infra/main.bicep` exists8- `./infra/main.parameters.json` exists9- Azure CLI authenticated1011## Validation Steps1213- [ ] 1. Bicep Compilation14- [ ] 2. Template Validation15- [ ] 3. What-If Preview16- [ ] 4. Authentication17- [ ] 5. Linting (optional)18- [ ] 6. Azure Policy Validation1920## Validation Details2122### 1. Bicep Compilation2324```bash25az bicep build --file ./infra/main.bicep26```2728**Pass:** No output (compiles cleanly)29**Fail:** Shows line numbers and errors3031### 2. Template Validation3233```bash34# Subscription scope35az deployment sub validate \36--location <location> \37--template-file ./infra/main.bicep \38--parameters ./infra/main.parameters.json3940# Resource group scope41az deployment group validate \42--resource-group <rg-name> \43--template-file ./infra/main.bicep \44--parameters ./infra/main.parameters.json45```4647### 3. What-If Preview4849```bash50az deployment sub what-if \51--location <location> \52--template-file ./infra/main.bicep \53--parameters ./infra/main.parameters.json54```5556**Expected output:**57```58Resource and property changes are indicated with these symbols:59+ Create60~ Modify61- Delete62```6364### 4. Authentication6566```bash67az account show68```6970### 5. Linting (optional)7172Use Bicep linter rules:7374```bash75az bicep lint --file ./infra/main.bicep76```7778### 6. Azure Policy Validation7980See [Policy Validation Guide](../../policy-validation.md) for instructions on retrieving and validating Azure policies for your subscription.8182## Checklist8384| Check | Command | Pass |85|-------|---------|------|86| Bicep compiles | `az bicep build` | ☐ |87| Template valid | `az deployment validate` | ☐ |88| What-if passes | `az deployment what-if` | ☐ |89| Auth valid | `az account show` | ☐ |90| Policies validated | MCP Policy tool | ☐ |9192## References9394- [Error handling](./errors.md)9596## Next9798All checks pass → **azure-deploy**99