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

查看:21
本文介绍了使用 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 生命周期管理 并在其中定义一个策略以删除超过 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.

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

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