Summary
Investigate whether bicep snapshot + predictedResources can supplement or simplify the resource group ownership classification pipeline introduced in #7603.
Context
In the PR #7603 discussion, @vhvb1989 identified that bicep snapshot's predictedResources output only includes resources the deployment creates — resources declared with the existing keyword are excluded. This could provide a fast, offline, deterministic signal for distinguishing created vs. pre-existing resource groups.
Investigation areas
- Tier 0 / Tier 1 supplement: Can
predictedResources serve as a "Tier 0" check that short-circuits the classification pipeline when Bicep source files are available?
- Source file availability:
azd down currently works purely from deployment metadata. Snapshot requires the original Bicep files — how often are they available at destroy time?
- Adopted/redeployed RGs: Does snapshot correctly handle RGs that were created externally then deployed into (operation type would be
Create but the RG pre-existed)?
- Nested deployments and modules: Are RGs created via nested deployments or modules flattened into
predictedResources?
- Deployment outputs: RGs referenced via deployment outputs (e.g.,
output rgName string = resourceGroup.name) are not resources — how to handle these?
- Deployment stacks path: The stacks path skips RG classification entirely — does snapshot interact with this?
Related
Summary
Investigate whether
bicep snapshot+predictedResourcescan supplement or simplify the resource group ownership classification pipeline introduced in #7603.Context
In the PR #7603 discussion, @vhvb1989 identified that
bicep snapshot'spredictedResourcesoutput only includes resources the deployment creates — resources declared with theexistingkeyword are excluded. This could provide a fast, offline, deterministic signal for distinguishing created vs. pre-existing resource groups.Investigation areas
predictedResourcesserve as a "Tier 0" check that short-circuits the classification pipeline when Bicep source files are available?azd downcurrently works purely from deployment metadata. Snapshot requires the original Bicep files — how often are they available at destroy time?Createbut the RG pre-existed)?predictedResources?output rgName string = resourceGroup.name) are not resources — how to handle these?Related