Delete VM with all associated resources
Deleting a VM is a lot of click work. I have to manually delete the associated Network interface, Network security group, Public IP address. And then, from the associated storage account, I have to drill down into the VHD container in the right Blob to delete the associated .vhd and .status files.
Also, I have to do it in the right order, because there are dependencies between the various objects. If not, it fails, and I get a big fat pink error.
Also, the overview list does not refresh after the 'success' notification is posted, so I sit there guessing which of the resources I already deleted and which I didn't.
It all feels boring, not fun and tedious!
This is still coming. The work is being completed now and we will be able to expose it in a few months.
Allan Ray commented
but i guess this can be sorted out by putting all the particular resource needed to one resource group when implementing it?
Azure seems to be the only major cloud provider that requires network devices, public ip addresses and virtual machines to be managed independently. It's not only a PITA for the web interface, but also a huge problem with the REST api and anyone trying to build solutions on top of it. The extra code required to ensure that associated resources are cleaned up is enormous, especially if you want to do it inside microservices which are failure tolerant. Please, please please fix not only the web interface, but also the API!!
Luke Lloyd commented
This can be done with PowerShell: https://vautomation.dev/2020/10/azure/azure-delete-vm-and-child-resources-using-powershell/
Alex van der Waal commented
Is this still coming? @Azure IaaS Engineering Team
A workaround using a PowerShell script is published at https://social.technet.microsoft.com/wiki/contents/articles/53980.azure-delete-vm-and-all-associated-resources-using-powershell-script.aspx.
In the document Microsoft states, "Also, in a large infrastructure, identifying the resources which were the part of the VM is very difficult and [sic] to delete manually."
If Microsoft admits that this task is "very difficult", why has this request been sitting on the back burner for so long?
Steve Griffith commented
Any update here?
Was there previously a feature that let you select/unselect the associated resources when deleting a vm? Maybe this was in a preview I saw or in a dream.. or maybe a feature from deleting a different type of resource.
It would be great to have this option though when deleting a vm. just checkmark yes/no to delete the associated disk, nic, ip address, etc.
Ran into issue today with this when deleting a v1 set of resources that have same machine names as v2 of those resources. a pain picking through the right and wrong disk, nic, ip to delete without blowing something up.
Has been more than a few months. When is this happening?
Christian Casteel commented
Any progress on this?
May I suggest a workaround: Try out terraform:
1) Infrastructure as a Code
2) You can set up CI/CD Pipelines and review changes to VM or other infrastructure
3) terraform code will handle the dependencies
More that one year now, no updated.
please implement this as soon as you can
Is there any update on the status of this?
Ross Worth commented
Please can the priority of this be increased, the current approaches are really substandard
Luke Lloyd commented
"This is still coming. The work is being completed now and we will be able to expose it in a few months". That was back in June 2019, a year ago! Come on MS :(
I inherited an azure environment from a previous engineer and I have to do a lot of housekeeping, we're talking about 50+ VMs that i need to purge with every associated resources. It's very painful to do!
Come on Microsoft. Just give us that this basic but essential option. it's 2020 already!
how the **** does this take 5 years to implement
Peter Strein commented
Any update on this? This would be a great feature both in the Portal, APIs, and SDKs.
I had the same problem with this process, to complex and nothing intuitive. A simples process for deleting a VM will be very welcome.
Tomasz Lisowski commented
Any update? This feature would really help me.