title | description | services | documentationcenter | author | manager | editor | tags | ms.assetid | ms.service | ms.workload | ms.tgt_pltfrm | ms.devlang | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Troubleshoot deleting Azure storage accounts, containers, or VHDs in a classic deployment| Microsoft Docs |
Troubleshoot deleting Azure storage accounts, containers, or VHDs in a classic deployment |
storage |
genlin |
felixwu |
tysonn |
storage |
0f7a8243-d8dc-432a-9d37-1272a0cb3a5c |
storage |
na |
na |
na |
article |
11/21/2016 |
genli |
[!INCLUDE storage-selector-cannot-delete-storage-account-container-vhd]
You might receive errors when you try to delete the Azure storage account, container, or VHD in the Azure portal or the Azure classic portal. The issues can be caused by the following circumstances:
- When you delete a VM, the disk and VHD are not automatically deleted. That might be the reason for failure on storage account deletion. We don’t delete the disk so that you can use the disk to mount another VM.
- There is still a lease on a disk or the blob that's associated with the disk.
- There is still a VM image that is using a blob, container, or storage account.
If your Azure issue is not addressed in this article, visit the Azure forums on MSDN and the Stack Overflow. You can post your issue on these forums or to @AzureSupport on Twitter. Also, you can file an Azure support request by selecting Get support on the Azure support site.
The following section lists common errors that you might receive when you try to delete the Azure storage accounts, containers, or VHDs.
When you navigate to the storage account in the Azure portal or Azure classic portal and select Delete, you might see the following error message:
Storage account StorageAccountName contains VM Images. Ensure these VM Images are removed before deleting this storage account.
You might also see this error:
On the Azure portal:
Failed to delete storage account . Unable to delete storage account : 'Storage account has some active image(s) and/or disk(s). Ensure these image(s) and/or disk(s) are removed before deleting this storage account.'.
On the Azure classic portal:
Storage account has some active image(s) and/or disk(s), e.g. xxxxxxxxx- xxxxxxxxx-O-209490240936090599. Ensure these image(s) and/or disk(s) are removed before deleting this storage account.
Or
On the Azure portal:
Storage account has 1 container(s) which have an active image and/or disk artifacts. Ensure those artifacts are removed from the image repository before deleting this storage account.
On the Azure classic portal:
Submit Failed Storage account has 1 container(s) which have an active image and/or disk artifacts. Ensure those artifacts are removed from the image repository before deleting this storage account. When you attempt to delete a storage account and there are still active disks associated with it, you will see a message telling you there are active disks that need to be deleted.
When you try to delete the storage container, you might see the following error:
Failed to delete storage container . Error: 'There is currently a lease on the container and no lease ID was specified in the request.
Or
The following virtual machine disks use blobs in this container, so the container cannot be deleted: VirtualMachineDiskName1, VirtualMachineDiskName2, ...
After you delete a VM and then try to delete the blobs for the associated VHDs, you might receive the following message:
Failed to delete blob 'path/XXXXXX-XXXXXX-os-1447379084699.vhd'. Error: 'There is currently a lease on the blob and no lease ID was specified in the request.
Or
Blob ‘BlobName.vhd’ is in use as virtual machine disk ‘VirtualMachineDiskName’, so the blob cannot be deleted.
To resolve the most common issues, try the following method:
-
Switch to the Azure classic portal.
-
Select VIRTUAL MACHINE > DISKS.
-
Locate the disks that are associated with the storage account, container, or VHD that you want to delete. When you check the location of the disk, you will find the associated storage account, container, or VHD.
-
Delete the disks use one of the following methods:
-
If there is no VM listed on the Attached To field of the disk, you can delete the disk directly.
-
If the disk is a data disk, follow these steps:
- Check the name of the VM that the disk is attached to.
- Go to Virtual Machines > Instances, and then locate the VM.
- Make sure that nothing is actively using the disk.
- Select Detach Disk at the bottom of the portal to detach the disk.
- Go to Virtual Machines > Disks, and wait for the Attached To field to turn blank. This indicates the disk has successfully detached from the VM.
- Select Delete at the bottom of Virtual Machines > Disks to delete the disk.
-
If the disk is an OS disk (the Contains OS field has a value like Windows) and attached to a VM, follow these steps to delete the VM. The OS disk cannot be detached, so we have to delete the VM to release the lease.
- Check the name of the Virtual Machine the Data Disk is attached to.
- Go to Virtual Machines > Instances, and then select the VM that the disk is attached to.
- Make sure that nothing is actively using the virtual machine, and that you no longer need the virtual machine.
- Select the VM the disk is attached to, then select Delete > Delete the attached disks.
- Go to Virtual Machines > Disks, and wait for the disk to disappear. It may take a few minutes for this to occur, and you may need to refresh the page.
- If the disk does not disappear, wait for the Attached To field to turn blank. This indicates the disk has fully detached from the VM. Then, select the disk, and select Delete at the bottom of the page to delete the disk.
Note
If a disk is attached to a VM, you will not be able to delete it. Disks are detached from a deleted VM asynchronously. It might take a few minutes after the VM is deleted for this field to clear up.
-
Switch to the Azure classic portal.
-
Select VIRTUAL MACHINE > IMAGES, and then delete the images that are associated with the storage account, container, or VHD.
After that, try to delete the storage account, container, or VHD again.
Warning
Be sure to back up anything you want to save before you delete the account. It is not possible to restore a deleted storage account or retrieve any of the content that it contained before deletion. This also holds true for any resources in the account: once you delete a VHD, blob, table, queue, or file, it is permanently deleted. Ensure that the resource is not in use.
VMs that were created in the classic deployment model and that have been retained will have the Stopped (deallocated) status on either the Azure portal or Azure classic portal.
Azure classic portal:
Azure portal:
A “Stopped (deallocated)” status releases the computer resources, such as the CPU, memory, and network. The disks, however, are still retained so that you can quickly re-create the VM if necessary. These disks are created on top of VHDs, which are backed by Azure storage. The storage account has these VHDs, and the disks have leases on those VHDs.