Tell the user which objects prevent an object from being deleted
I wanted to delete a Virtual Network and it kept telling me that it was in use and that I should come back later if I just deleted an object that used this Network.
However, the actual reason was that the Virtual Network still had a Gateway configured. As this gateway only shows up inside the Virtual Network and not on "All Resources", I wasted hours to figure out why I couldn't delete the network.
If I can't delete an object because it is in use or has children, give me a list of those objects that prevent the deletion.
Hi Daniel, we’ve made some updates here, our error messages tell you what resources are preventing delete VNet.
Further, we created a diagnostic in the support work flow (Azure Portal, support ticket creation: Virtual Network > Management > Cannot delete VNet) to tell you exactly what resources are preventing delete, too!
Hope this helps, let us know your feedback
- Anavi N [MSFT]
Brandon Kearns commented
I had this same issue recently. I ended up opening a ticket and felt stupid when the problem was determined to be the gateway still residing.