Immutable solution version
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-
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-plus-old.
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.
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 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Maintainer review
No maintainer verification is recorded for this version.
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
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>