Skip to content

[Issue] azd down removes resource groups not created by azd #2916

@tvriesde

Description

@tvriesde

Output from azd version
Run azd version and copy and paste the output here:
azd version 1.4.3 (commit d165bd2)

Describe the bug
Description of issue you're seeing...
azd down seems to delete resources by deleting entire resource groups.

For resource groups created by azd up, this works, but if your bicep also contains resource creation in an existing rg, then this could lead to unwanted removal of resources.

A solution to prevent unwanted removals, is to lock the existing rg, but then azd down failes.

To Reproduce
Scenario 1:

  1. create "existing" rg with vnet
  2. create azd project which creates a new rg and creates a subnet in the existing rg
  3. azd down

Scenario 2:

  1. create "existing" rg with vnet
  2. add lock to rg
  3. create azd project which creates a new rg and creates a subnet in the existing rg
  4. azd down

This issue was customer reported, I reproduced with the following azd project: https://github.com/tvriesde/azdstarter

Expected behavior
azd down should not remove entire resource groups which already existed before azd up. Instead it should only remove resources part of the azd up deployment.

Metadata

Metadata

Assignees

Labels

area/core-cliCLI commands, cmd/, internal/cmd/customer-reportedidentify a customer issueenhancementNew feature or improvementquestionQuestion about usage

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions