Delete Storage Account

Gareth Hill 1 Reputation point
2022-05-03T10:13:52.457+00:00

I'm trying to remove a storage account we used for testing. I'm running into a problem (Probably obvious as I'm posting here!)

When I try to delete the account I get the error:

Failed to update data protection settings for 'srtofficeveeambackup'. Error: Conflicting feature 'Account level WORM' is enabled. Please disable it and retry.

This seems to be set above the level of my storage container, If I go to the container > Data Protection and attempt to turn off "Enable versioning for blobs" I get the same error.

I've tried the help, and searching around but I'm unable to find how to either turn off, or modify my "Account level WORM" does anyone have any pointers please?

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,538 questions
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. SaiKishor-MSFT 17,336 Reputation points
    2022-05-03T21:35:56.48+00:00

    @Gareth Hill Thank you for reaching out to Microsoft Q&A. I understand that you are having issues with deleting your storage account where you get the error- "Error: Conflicting feature 'Account level WORM' is enabled. Please disable it and retry."

    This is because your storage account is protected by WORM policy i.e., your storage account has version-level immutability support enabled.

    If version-level immutability support is enabled for the storage account and the account contains one or more containers, then you must delete all containers before you delete the storage account, even if there are no immutability policies in effect for the account or containers.

    Now, HERE are steps to Modify or delete an unlocked retention policy. If there are any legal holds on the data, here are steps to clear the same as well.

    Hope this helps. Please let us know if you have any further questions and we will be glad to assist you further. Thank you!

    Remember:

    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

    Want a reminder to come back and check responses? Here is how to subscribe to a notification.

    2 people found this answer helpful.
    0 comments No comments

  2. Travis Warlick 5 Reputation points
    2023-03-01T15:34:22.29+00:00

    For those continuing to struggle with this: the missing steps, after removing the retention policies and legals, are to 1) delete all the objects out of the containers and 2) delete the containers. You should then be able to delete the storage account.

    1 person found this answer helpful.

  3. Gareth Hill 1 Reputation point
    2022-05-04T12:29:55.403+00:00

    Thank you for the response, but that isn't working for me either.

    When I go to Storage Account>Containers and attempt to delete:

    198872-image.png

    I get the following Error:
    Failed to delete 1 out of 1 container(s):
    officebackup: The requested operation is not allowed as the container has a immutable storage with versioning enabled.

    When I attempt to turn off version of for the Storage Account

    198865-image.png

    I get:
    Failed to update data protection settings for 'srtofficeveeambackup'. Error: Conflicting feature 'Account level WORM' is enabled. Please disable it and retry.

    I do not see an option to turn off the immutable storage for the container directly


  4. Gareth Hill 1 Reputation point
    2022-05-10T07:41:56.003+00:00

    Apologies I do appreciate your help but I was out of touch for a few days.

    I've just attempted this, however no policies exist, and the same restrictions apply to removing it.


  5. Kobus 0 Reputation points
    2023-04-12T06:01:36.21+00:00

    If policies did exist, they would have been applied to the container/folder/blob and an Expiry Date for the policy would have been set on these blobs, which would require you to wait until the Expiry Date lapses. Try this to get the last Expiry Date for all the blobs within a specific container. (This can take quite a long time to run depending on the number of blobs you have)

    
    $StorageAccountName = "StorageAccount" # Enter your information here
    $StorageAccountKey = "StorageAccountKey" # Enter your information here
    $ContainerName = '' # Enter your information here
    
    # Get Storage context to work with
    $ctx = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
    $maxCount = 1000
    $total = 0
    $token = $Null
    $lastDate = $Null
    $fOutputFile = "C:\Temp\BlobProperties_ImmutabilityPolicy.csv"
    # Set Headers for .csv file
    "ExpiresOn,Name" | Out-File $fOutputFile -Encoding ascii
    # Loop through all blobs in blocks of 1000
    Do {
        $blobs = Get-AzStorageBlob -Context $ctx -Container $ContainerName -MaxCount $maxCount -ContinuationToken $token
        $blobCount = 1
        #Loop through the batch
         Foreach ($blob in $blobs)
         {
             # Check the Expiry Date for the blob and update the $lastDate variable
             if($blob.BlobProperties.ImmutabilityPolicy.ExpiresOn.LocalDateTime -gt $lastDate) {$lastDate = $blob.BlobProperties.ImmutabilityPolicy.ExpiresOn.LocalDateTime}
             $expiresOn = '{0:yyyy/MM/dd HH:MM:SS}' -f $blob.BlobProperties.ImmutabilityPolicy.ExpiresOn.LocalDateTime
             $export = $expiresOn + ',' + $blob.Name          
             $export | Out-File $fOutputFile -Encoding ascii -Append
             #Display progress bar
             $percent = $($blobCount/$maxCount*100)
             Write-Progress -Activity "Processing blobs" -Status "Processing blob $blobCount of $maxCount blobs. $percent% Complete" -PercentComplete $percent
             $blobCount++
         }
         #Update $total
         $total += $blobs.Count
          
         #Exit if all blobs processed
         If($blobs.Length -le 0) { Break; }
          
         #Set continuation token to retrieve the next batch
         $token = $blobs[$blobs.Count -1].ContinuationToken
         Write-Host "Total Blobs Processed: " $total
     }
      While ($null -ne $token)
      Write-Host "Latest Date for Policy Expiry: "$lastDate
      Write-Host "Total Blobs Processed: "$total
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.