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.