Azure Storage Account pending migration prevents deletion of storage account. How do I get past this?

Erik Snyder 25 Reputation points
2024-01-17T22:29:30.1766667+00:00

How can I get remove an old storage account*?* The resource receives portal error: "Error: AccountPendingMigrationtoSrp" and various PowerShell errors like: Set-AzStorageAccount : AccountPendingMigrationToSrp The specified account is pending migration to SRP. I have read the reviews about using Move-AzureStorageAccount -Abort and Remove-AzureStorageAccount by Sumarigo (https://learn.microsoft.com/en-us/answers/questions/412037/accountpendingmigrationtosrp). I have tried to use the portal, and PowerShell with both the Azure cmdlets and Az cmdlets to no avail. I even enlisted Bing's artificial intelligence to no avail. It gets similar error messages on the portal and through PowerShell. I still cannot remove the storage account from my subscription. I have already copied and moved all of the files within the storage account, but I still am unable to remove the resource from my subscription. I have tried to Abort the migration and complete the migration but nothing works. Any help would be much appreciated.

Best,
-Erik

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,778 questions
{count} votes

Accepted answer
  1. KarishmaTiwari-MSFT 18,642 Reputation points Microsoft Employee
    2024-02-06T01:23:37.5666667+00:00

    @Erik Snyder

    I was tracking the support ticket and I'm glad that you were able to resolve your issue. I will post the solution here so that others experiencing the same thing can reference this!

    Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer. Accepted answers show up at the top, resulting in improved discoverability for others.

    Issue: Cannot delete storage account.

    Cause: Pending migration from classic to ARM.

    Solution: Worked with the support engineer and followed the steps to migrate the storage account from classic to ARM and then were able to delete the storage account.

    If your issue remains unresolved or have further questions, please let us know in the comments how we can assist. We are here to help you and strive to make your experience better and greatly value your feedback.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 18,642 Reputation points Microsoft Employee
    2024-01-18T07:40:12.6+00:00

    @Erik Snyder Can you please share what errors are you seeing when you use the following commands:

    Cancel Migration :     Move-AzureStorageAccount -Abort -StorageAccountName "Saname"      
    Remove Storage Account:     Remove-AzureStorageAccount -ResourceGroupName "RG01" -AccountName "mystorageaccount" -Force  -debug -verbose
    

    If you do not have all of the modules installed in PowerShell, it can throw an error saying: The term 'Move-AzureStorageAccount' is not recognized as the name of a cmdlet.

    If you see that error, re-install the Az module, and follow the commands again, that should resolve it.

    Also, ensure that there are no dependencies or resources relying on the storage account before attempting to delete it.