Azure / Azure/azure-cli

Commands which create multiple resources should have an option on delete to delete all related resources

Open
#3,922 5 comments 2 reactions 1 assignee Assigned to @mmyyrroonn View on GitHub
act-quality-productivity-squad feature-request Infrastructure Network Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

Referenced from discussion in #3918 and #3791.

Any create command which creates multiple resources should have a flag that will delete (or attempt to delete) any related resources. For example, `vm delete -g myRG -n myVM --delete-related-resources` would also delete: the managed disk, the NSG, the VNET, the public IP etc. In other words, the goal would be that if you ran the simplest create and then the delete with this flag, it would delete everything that the create command created. If you used existing resources, there's no real way to know, but it would make a best effort to delete them. This might fail (for example if a VNET was associated with some other VMs) and we should report at the end of this command which resources were attempted to be deleted and whether the delete failed or succeeded.

Issue #3902 will enhance delete functionality for the generic resource delete, but this would be a tailored delete for our multi-resource create commands (of which there are fewer than 10).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.