Azure Blob 存储生命周期管理 - 嵌入式文件夹

问题描述

我目前正在尝试在我嵌入文件夹的容器上实现生命周期管理,如下所示:

container1/1/test/done_filename.txt
container1/1/processed/complete_filename.txt
container1/1/wip_filename.txt

我尝试创建一个规则过滤器来删除 test 文件夹下以 done 开头的文件,但是我等了 48 小时,它仍然没有被删除

Rule filter:
delete after 1 day 
Prefix Match:
file with this prefix: container1/1/test/done_

我从微软和网上看到的所有示例都只提到“myContainer/prefix”,我是否理解生命周期管理功能不支持文件夹/完整路径?所有文件都必须在容器的根目录内吗?或者我在这里做错了什么。

更新显示规则定义:

enter image description here

enter image description here

enter image description here

我希望上面的内容删除“container1/1/test/”下以“done_”开头的任何文件,但几天后我检查时该文件仍然存在,即使该文件没有被修改。>

解决方法

如果您启用了规则,那么您的策略和前缀匹配就可以了。

您需要检查一些可以阻止 blob delete operation 的设置:

1.确保您可以手动删除这些 blob。您可以尝试手动删除其中之一。为什么我们需要这样做?如果您有 leased these blobsset immutability policies,则不允许进行删除操作。

2.检查存储帐户的网络窗格中的设置。并确保选择“允许从所有网络访问”选项:

enter image description here

,

我可以在这里找到解决方案:https://docs.microsoft.com/answers/answers/154361/view.html

当您像我们一样因为安全限制而使用选定的网络时,正确的解决方案是在网络下启用“允许受信任的 Microsoft 服务访问此存储帐户”。