如何将过滤器添加到容器中以删除斑点,除了虚拟文件夹中的一些斑点?

发布于 2025-01-21 04:27:08 字数 423 浏览 1 评论 0 原文

我在名为Records(Azure存储帐户)的容器中有一组文件夹。通常,记录容器中存在的斑点(文件夹)将根据生命周期管理规则删除。

规则:如果斑点的存在超过30天,则删除斑点。

但是根据我的情况,所有斑点(文件夹)都应删除,除了一个blob(文件夹),其中blob(文件夹)名称为 backup 在容器中。

有什么方法可以添加不删除特定斑点的规则(在我的情况下是文件夹)? 因此,当现有规则运行时,备份文件夹不应删除。

I am having set of folders in container named records (Azure storage account). In general what ever the blobs(folders) present in records container it will be deleted as per lifecycle management rule.

Rule: if blob exists more than 30days than it will delete the blob.

But As per my case, All blobs (folders) should delete except one blob (folder) where the blob(folder) name is Backup in the container.

Is there any way to add a rule for not deleting particular blob(In my case it is folder)?
enter image description here
So backup folder shouldn't delete when the existing rule run.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱本泡沫多脆弱 2025-01-28 04:27:08

例如,使用Azure门户为特定斑点创建租约。租赁可防止过程用斑点做任何事情。这包括生命周期管理规则。

您也可以使用 rest api 或许多储存skds

另一个选项是不使用生命周期管理规则,而是编写一个计划的Azure功能,该功能删除了30天以外的斑点以外的斑点,除了具有 backup 的名称。

请注意:如果您已启用那么您有目录的概念,但这些概念不能租用。如果您没有,那么您应该意识到文件夹是一个虚拟构造,因此不能因为它们实际上是斑点而被租用。请参阅。因此,在这种情况下,您必须单独租用每个斑点或编写一次可以做的脚本。

Create a lease for the particular blob using the azure portal for example. A lease prevents processes from doing anything with the blob. This includes lifecycle management rules.

enter image description here

You can also acquire or break a lease using the rest api or one of the many storage SKDs.

Another option would be to not use the lifecycle management rules but write a scheduled azure function that deletes blob older than 30 days except the ones having backup in their name.

Please do note: if you have enabled "Hierarchical namespace" then you have the concept of directories, but those cannot be leased. If you did not then you should realise that folders are a virtual construct and as such cannot be leased as they are actually blobs. See the docs. So in that case you have to individually take a lease on each blob or write a script that does it once.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文