一定时间后删除天蓝色的 blob
Delete blob in azure after certain time
是否可以让 blob 在一定时间后自动删除?
我需要在上传到 Azure 几个小时后删除我的 blob,我不需要将它们存储超过 10 天。
很遗憾,目前还没有。使用 Webjobs 或类似的东西,这可以在 Azure 存储之上完成,但平台本身没有提供任何东西。
简而言之,此时 不可能 在 Azure 中的 blob 本身上的任何 setting/configuration 使 blob 在特定时间后自动删除。
您将需要依赖其他服务,例如 Azure WebJobs 或 Azure Automation 来自动执行此类任务。
自 2019 年 3 月起,这可以通过 Azure Blob 存储中的生命周期管理支持来实现。参见
Azure Blob storage lifecycle management offers a rich, rule-based
policy for GPv2 and Blob storage accounts. Use the policy to
transition your data to the appropriate access tiers or expire at the
end of the data's lifecycle.
The lifecycle management policy lets you:
- Transition blobs to a cooler storage tier (hot to cool, hot to archive, or cool to archive) to optimize for performance and cost
- Delete blobs at the end of their lifecycles
- Define rules to be run once per day at the storage account level Apply rules to containers or a subset of blobs (using prefixes as filters)
是否可以让 blob 在一定时间后自动删除?
我需要在上传到 Azure 几个小时后删除我的 blob,我不需要将它们存储超过 10 天。
很遗憾,目前还没有。使用 Webjobs 或类似的东西,这可以在 Azure 存储之上完成,但平台本身没有提供任何东西。
简而言之,此时 不可能 在 Azure 中的 blob 本身上的任何 setting/configuration 使 blob 在特定时间后自动删除。
您将需要依赖其他服务,例如 Azure WebJobs 或 Azure Automation 来自动执行此类任务。
自 2019 年 3 月起,这可以通过 Azure Blob 存储中的生命周期管理支持来实现。参见
Azure Blob storage lifecycle management offers a rich, rule-based policy for GPv2 and Blob storage accounts. Use the policy to transition your data to the appropriate access tiers or expire at the end of the data's lifecycle.
The lifecycle management policy lets you:
- Transition blobs to a cooler storage tier (hot to cool, hot to archive, or cool to archive) to optimize for performance and cost
- Delete blobs at the end of their lifecycles
- Define rules to be run once per day at the storage account level Apply rules to containers or a subset of blobs (using prefixes as filters)