Solution skill
Diagnose: Bicep what-if shows Delete on a resource you did not intend to remove
Complete solution
Symptom: Bicep what-if shows Delete on a resource you did not intend to remove Cause: What-if Delete lines mean the template no longer declares a resource that exists - usually because deployment mode is Complete, or the resource moved modules/renamed and the template treats it as new-
TL;DR: Symptom: Bicep what-if shows Delete on a resource you did not intend to remove Cause: What-if Delete lines mean the template no longer declares a resource that exists - usually because deployment mode is Complete, or the resource moved modules/renamed and the template treats it as new- CONFIRM IT CONFIRM: check the deployment command for --mode Complete (Incremental is the default and never deletes). Check whether the resource was renamed in the template - rename = delete + create to ARM.
The fix
SYMPTOM Bicep what-if shows Delete on a resource you did not intend to remove
CONFIRM IT CONFIRM: check the deployment command for --mode Complete (Incremental is the default and never deletes). Check whether the resource was renamed in the template - rename = delete + create to ARM.
FIX FIX: switch to Incremental mode unless you truly want Complete; restore the resource declaration or pin the rename as a deliberate migration with backup. Never proceed past an unexpected Delete line - what-if is the last guardrail before data loss.
VERIFY VERIFY: re-run what-if: no Delete lines except the ones you intend; then deploy.
When to use this
- This covers exactly what the title says: Diagnose.
- You are setting this up for the first time, or auditing an existing setup.
- You want the key gotchas in one place before you start.
When not to use this
- You are doing a different workflow with Diagnose; these steps are specific to the title above.
- You need the full reference docs; this is the short path, not the manual.
Compatibility
- Not pinned to a specific version; follows current Diagnose behavior.
Why it happens
CAUSE What-if Delete lines mean the template no longer declares a resource that exists - usually because deployment mode is Complete, or the resource moved modules/renamed and the template treats it as new-plus-old.
Edge cases
- FIX FIX: switch to Incremental mode unless you truly want Complete; restore the resource declaration or pin the rename as a deliberate migration with backup.
Evidence
Diagnostic skill indexed by the exact error string. Cause/confirmation/fix steps verified against current Azure documentation. Evidence: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_a8i1sRV0le1I60Ng3BzxuQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Diagnose: Bicep what-if shows Delete on a resource you did not intend to remove <span>— Vectle</span></a>