简体   繁体   中英

Delete Immutable container with expired retention in Azure Storage Account

I would like to delete a container within an Azure storage account. The retention is already expired and the data was not changed. But i'm not able to delete this container, because it says that it is still immutable.

Is there is PowerShell command available to see how long the retention will apply?

When a time-based retention policy is applied to a container, all blobs in the container will stay in the immutable state for the duration of the effective retention period. Container and storage account deletion is also not permitted if there are any blobs in a container that are protected by a legal hold or a locked time-based policy. A legal hold policy will protect against blob, container, and storage account deletion. Both unlocked and locked time-based policies will protect against blob deletion for the specified time. Both unlocked and locked time-based policies will protect against container deletion only if at least one blob exists within the container. Only a container with a locked time-based policy will protect against storage account deletions; containers with unlocked time-based policies do not offer storage account deletion protection nor compliance.

So please check the legal holds if any along with immutable policy set within containers. Once the blobs are also removed, try to delete the container and then the storage account.

Note: Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container.

What happens if I try to delete a container with a time-based retention policy or legal hold?

The Delete Container operation will fail if at least one blob exists within the container with either a locked or unlocked time-based retention policy or if the container has a legal hold. The Delete Container operation will succeed only if no blobs exist within the container and there are no legal holds.

What happens if I try to delete a storage account with a container that has a time-based retention policy or legal hold?

The storage account deletion will fail if there is at least one container with a legal hold set or a locked time-based policy. A container with an unlocked time-based policy does not protect against storage account deletion. You must remove all legal holds and delete all locked containers before you can delete the storage account.

Blob Containers - Delete Immutability Policy Aborts an unlocked immutability policy . The response of delete has immutabilityPeriodSinceCreationInDays set to 0 . ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container.

For more details refer this link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM