Azure – Cannot delete an empty Storage Account on Azure RM

azure

When trying to delete Azure Resource Group in the Azure Portal I get an error pointing to a Storage Account which could not be deleted.

Indeed, trying to delete the Storage Account results in an error:

Failed to delete storage account 'clie6aa7aa53aa7ace414833'. Error: The storage account cannot be deleted due to its artifacts being in use. For more information on troubleshooting this issue, see https://azure.microsoft.com/documentation/articles/storage-cannot-delete-storage-account-container-vhd/

The article is not helpful, I have already deleted all blobs and files. There are no remaining containers on the SA:

enter image description here

When trying to delete from PowerShell I get:

PS C:\> Remove-AzureRmStorageAccount -ResourceGroupName myresourcegroupname001 -StorageAccountName cl
i6c4ccaf5d718f00c14833

Confirm
Remove Storage Account 'cli6c4ccaf5d718f00c14833' and all content in it
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y
Remove-AzureRmStorageAccount : Operation returned an invalid status code 'Conflict'
At line:1 char:1
+ Remove-AzureRmStorageAccount -ResourceGroupName myresourcegroupname00 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Remove-AzureRmStorageAccount], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.RemoveAzureStorageAccountCommand

Currently I have two such undeletable, empty storage accounts – one of which remains for over 72 hours.

Is there anything I can do to delete this Storage Account?

Best Answer

I had the same problem that went on for several days. I was eventually able to resolve the problem by doing the following:

  1. Create a new VM (in my case an Ubuntu VM with SSD) in the same Resource Group as the problematic Storage Account
  2. Add the drive to the same Resource Group, same region, etc
  3. Delete the new VM, then delete the VHD container for the VM in the problematic Storage Account
  4. Remove the problematic Storage Account
Related Topic