Loading Posts...

Unable To Delete An Azure Resource Group Due To A Non-existent Storage Account

I was working in one of my Azure projects and I wanted to delete one of my created resource groups, and I was unable to delete the Azure Resource Group Due to a non existent Storage account. Actually I remember, I was trying to create a Storage Account with the exact name few days ago and failed due to the Azure naming standards. I can confirm that the subjected Storage Account was not in my resources and creation was never completed. But error said I got the Storage account under my Resource Group.

Failed to delete resource group [RESOURCE_GROUP_NAME]: Deletion of resource group ‘[RESOURCE_GROUP_NAME]’ failed as resources with identifiers ‘Microsoft.Storage/storageAccounts/[STORAGE_ACCOUNT_NAME]’ could not be deleted. The provisioning state of the resource group will be rolled back.

Delete An Azure Resource Group : Error

As stating in the above screen capture “tc-aks-strg-0001” was the subjected Storage Account which failed to create before.

I tried many attempts to delete the Resource Group (TC-RCG-0001) and it was continue to failing. In the Activity logs I saw the below error message. By looking at the Activity Logs you can I imagine how much I tried to delete it.

“Error”:{“Code”:”ResourceGroupDeletionBlocked”,”Target”:null,”Message”:”Deletion of resource group ‘TC-RCG-0001’ failed as resources with identifiers ‘Microsoft.Storage/storageAccounts/tc-aks-strg-0001′ could not be deleted. The provisioning state of the resource group will be rolled back. The tracking Id is ’97a2a1d5-ddac-4dc3-a4bb-3cc5999675e4’. Please check audit logs for more details.”,”Details”:[{“Code”:null,”Target”:”/subscriptions/e1ba9d9d-799d-45cd-87ce-0485b8db72f5/resourceGroups/TC-RCG-0001/providers/Microsoft.Storage/storageAccounts/tc-aks-strg-0001″,”Message”:”{\”error\”:{\”code\”:\”AccountNameInvalid\”,\”message\”:\”tc-aks-strg-0001 is not a valid storage account name. Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only.\”}}”,”Details”:null,”AdditionalInfo”:null}],”AdditionalInfo”:null}}

Delete An Azure Resource Group : Activity Log

Finally, I used Azure PowerShell to delete the subjected Storage Account even though it is not in my Account under Resources. Using below command. It was successful and disappeared in the Resource Group list

Remove-AzureRmStorageAccount -Name "[NAME_OF_THE_STORAGE_ACCOUNT]" [RESOURCE_GROUP] -force
Delete An Azure Resource Group : PowerShell Used to delete it

After that, I was able to delete my Resource Group successfully.

Click to rate this post!
[Total: 5 Average: 5]

Aruna Lakmal

Associate Technical Specialist, Sri Lanka. Technology junky, enthusiast, a VMware vExpert and a blogger with more than 8 years of Experience in Virtualization and Cloud Native technologies.

Get Updates Directly To Your Inbox!

   

Leave a Comment

Loading Posts...