Template validation works only on the main deployment
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
The report describes two validation-level issues: child deployments do not inherit the setting, and Az PowerShell deployment commands may omit it from the request. Start by tracing deployment and deployment-stack validation handling for CLI and PowerShell, then compare the request paths with what-if. Done means both reported behaviors are covered by fixes and regression tests; the issue does not name specific files or tests.
Written by the indexing model from the issue text.
Description
Bicep version
Bicep CLI version 0.49.2 (b34271ac51)
Describe the bug
Both Az CLI and Az PS have template validation mode parameter for deployments and deployment stacks. I have never used that parameter before until I have stumbled on a bug in Front Door resource where the validation stops the actual deployment. After using it what I have found is that:
- What if passes fines and results are generated. Tried on stack, most likely the same for regular deployments what-if.
- The deployment starts fine where previously it was failing before start.
However when the deployment reaches the problematic resource defined in the template which was previously giving the same validation error is generated. So the deployments started by the main deployment does not inherit that validation level. This makes this option not very usable in real world as 99% of modules I use they generate child deployments.
Additionally there is a bug in new-azResourceGroupDeployment cmdlet where the provided value for -ValidationLevel parameter is not added to the deployment. You can see that behavior using -Debug switch. To compare you can also see Get-AzResourceGroupDeploymentWhatIfResult with -Debug that validation level is added to the Rest call. I have also compared it with az deployment group create --debug and that one also adds the validation level. Most likely this bug is present in all deployment PS commands, may be even on deployment stacks commands as well. I am using Az.Resources 10.2.1.
To summarize there are two issues:
- Validation level is applied only to the main template deployment and not the child ones. This one applies to both Az CLI and Az PowerShell. For Az PowerShell it is not applied at all. This kind of approach works if you just do what-if results but as soon as an actual deployment is done it fails with the same errors on the child deployments where it was previously failing with Provider (default) mode.
- For deployment commands like New-azDeployment ValidationLevel parameter value is not applied. The difference can be see by with --debug/-Debug switches on Get-AzDeploymentWhatIfResult/az deployment group create commands.
To Reproduce
Steps to reproduce the behavior:
Provider.
Additional context
Add any other context about the problem here.
- Dominant language
- Bicep
- Stars
- 3.7k
- Forks
- 833
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 81
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/bicep
-
AI Triaged bug Needs: Triage :mag: story: bicep parameters
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/bicep#20654 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement Needs: Upvote VisualStudio
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Azure/bicep#17997 · 1 reaction ·
Maintainers usually reply within 1 day
-
AI Triaged Needs: Triage :mag: OnlyifNotExists
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Azure/bicep#20634 · 2 comments ·
Maintainers usually reply within 1 day
-
AI Triaged bug Needs: Triage :mag:
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Azure/bicep#20584 · 2 comments ·
Maintainers usually reply within 1 day
-
Preserve member types through open-object union() and spreads instead of rebuilding them in secret analysisPossibly taken @andyleejordan claimed this 21 days ago. OpenAI Triaged enhancement linter-false-positive Needs: Triage :mag: story: linter type system
Azure/bicep#20558 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
area: budget priority: low type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
scttfrdmn/cargoship#1535 · 1 comment ·
Maintainers usually reply within 1 day
-
level/task reporter/qa type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wazuh/wazuh-documentation#11168 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Chocobozzz/PeerTube#7901 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Azure/sap-automation#1417 ·
Maintainers usually reply within 2 days