问题描述
我想创建一个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天以上的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!