How to Delete a VHD BLOB on for an Azure VM

A while ago I signed up for a 3 month trial for Microsoft Azure to allow me to continue to use the Azure Backup service after Microsoft moved it from Windows Azure Online Backup Preview into a more mainstream service.

Last night I decided to have a play whilst I’m still on the trial to see how quickly I could stand up a Windows Server 2012 VM instance. The answer is quickly by the way. Within five minutes, I was able to download the .rdp file and connect to the machine, but I digress.

After I was finished, I deleted the VM, but the disk remains in the event that you want to reattach it to another VM. When I tried to delete the .vhd file I got an error that it was still in-use. I wasn’t able to find the answer initially, but after a post on TechNet someone came straight back with the solution in an Azure Technical Support (WATS) blog post at http://blogs.msdn.com/b/windows_azure_technical_support_wats_team/archive/2013/02/05/iaas-unable-to-delete-vhd-there-is-currently-a-lease-on-the-blob.aspx.

In a nutshell, although the VM is deleted, it leaves behind a disk mount resource which is used to link the VM to the VHD BLOB. Follow the steps in the post to delete the link an you will be given an option to delete the actual .vhd file as well as the link. Job Done.

richardjgreen

Richard works as a Cloud Consultant for Fordway Solution where his primary focus is to help customers understand, adopt and develop with Microsoft Azure, Office 365 and System Center. Richard Green is an IT Pro with over 15 years' of experience in all things Microsoft including System Center and Office 365. He has previously worked as a System Center consultant and as an internal solutions architect across many verticals. Outside of work, he loves motorbikes and is part of the orange army, marshaling for NGRRC, British Superbikes and MotoGP. He is also an Assistant Cub Scout Leader.