none
Azure Trial: Can't delete Azure VHD because...

    Question

  • All,

    Would greatly appreciate any help after a frustrating couple of hours trying to evaluate Azure.  I setup a Windows Server 2012 Azure VM.  Couldn't logon using any credentials, so I figured I did something dumb and would just delete it and start over. 

    I deleted the VM and its associated network, etc.  However, the storage resource group (classic) is still there.  I can't delete the resource group because I haven't deleted the VHD.  When I try to delete the VHD, I get a message that says "There is currently a lease on the blob and no lease ID was specified in the request."  I can't contact support, because I'm asked for Enterprise support credentials that I don't have.  Apparently, there's no free support included in the trial.  Catch 22's all around.

    Any advice?  Thanks in advance.

    Friday, November 13, 2015 2:15 AM

Answers

  • You need to first remove the "Azure Disk" that is associated with your VHD. Only then you will be able to delete the VHD itself themselves. Use the PowerShell cmdlet Donovan shared to remove the disk and delete VHD.

    >>Remove-AzureDisk -DiskName "MyDataDisk" –DeleteVHD

    Monday, November 16, 2015 10:23 PM

All replies

  • Couple of options, firstly you could try the following powershell script to break the lease on the VHD then delete it:
    https://gallery.technet.microsoft.com/scriptcenter/How-to-break-the-locked-c2cd6492

    Alternatively you could try and delete the VHD directly from powershellusing the Remove-AzureDisk command

    Remove-AzureDisk -DiskName "MyDataDisk" –DeleteVHD 

    • Proposed as answer by Pradnya K Monday, November 16, 2015 10:32 PM
    Friday, November 13, 2015 2:50 AM
  • You need to first remove the "Azure Disk" that is associated with your VHD. Only then you will be able to delete the VHD itself themselves. Use the PowerShell cmdlet Donovan shared to remove the disk and delete VHD.

    >>Remove-AzureDisk -DiskName "MyDataDisk" –DeleteVHD

    Monday, November 16, 2015 10:23 PM