且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 Azure 函数从 Azure Blob 存储中删除超过 X 天的文件

更新时间:2023-02-09 09:08:37

假设您的存储帐户的类型是 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 生命周期管理 并在其中定义一个策略以删除超过 30 天的 Blob,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/en-us/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.