使用Azure函数从Azure Blob存储中删除X天以上的文件 [英] Delete files older than X number of days from Azure Blob Storage using Azure function

查看:110
本文介绍了使用Azure函数从Azure Blob存储中删除X天以上的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Azure函数,该函数在上次修改超过30天时会从azure blob存储中删除文件. 任何人都可以帮忙或有文档来做到这一点吗?

I want to create an Azure function that deletes files from azure blob storage when last modifed older than 30 days. Can anyone help or have a documentation to do that?

推荐答案

假设您的存储帐户类型为General Purpose v2 (GPv2)Blob Storage,则实际上您不必自己做任何事情. Azure存储可以为您做到这一点.

Assuming your storage account's type is either General Purpose v2 (GPv2) or Blob Storage, you actually don't have to do anything by yourself. Azure Storage can do this for you.

您将使用Blob Lifecycle Management并在其中定义一个策略,以删除blob(如果它们已超过30天),Azure存储将为您处理删除问题.

You'll use Blob Lifecycle Management and define a policy there to delete blobs if they are older than 30 days and Azure Storage will take care of deletion for you.

您可以在此处了解更多信息: https://docs.microsoft.com/zh-CN/azure/storage/blobs/storage-lifecycle-management-concepts .

You can learn more about it here: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-lifecycle-management-concepts.

这篇关于使用Azure函数从Azure Blob存储中删除X天以上的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆