[英]How to delete blob immutable file from Azure using c#
I have a file in Azure blob stroage with legal hold policy.我在 Azure blob stroage 中有一个具有合法保留政策的文件。 When am trying to delete that file, I am getting msg "blobImmutableDueToLegalHold".
当我试图删除该文件时,我收到消息“blobImmutableDueToLegalHold”。 I am trying to achieve task by using c#
我正在尝试通过使用 c# 来完成任务
In general this occurs when the operation is not permitted as the blob is immutable due to one or more legal holds.通常,当不允许操作时会发生这种情况,因为由于一个或多个合法保留,该 blob 是不可变的。
In order to resolve you need to create an immutable policy through portal/sdks.为了解决您需要通过门户/SDK 创建不可变策略。 You can enable immutable policy for the container or for the whole storage account.
您可以为容器或整个存储帐户启用不可变策略。 For Storage account, you can navigate to Dataprotection and check
Enable version-level immutability support
.对于存储帐户,您可以导航到 Dataprotection 并选中
Enable version-level immutability support
。
You can even enable this from your cli using您甚至可以使用 cli 从您的 cli 启用此功能
az storage account create \
--name <storage-account> \
--resource-group <resource-group> \
--enable-alw \
--immutability-period-in-days 90 \
--immutability-state unlocked \
--allow-protected-append-writes true
For container you can enable immutable policy by navigating to your container > Access policy > Add policy > Legal hold > ok.对于容器,您可以通过导航到您的容器 > 访问策略 > 添加策略 > 合法保留 > 确定来启用不可变策略。
REFERENCES: Configure immutability policies for blob versions参考: 为 blob 版本配置不变性策略
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.