1

Is it possible to make a blob be able to auto delete after a certain time?

I need to delete my blobs after few hours they were uploaded to azure, I don't need store them more than 10 days.

David Makogon
  • 69,407
  • 21
  • 141
  • 189
Monik
  • 47
  • 3

3 Answers3

1

Not at this time, unfortunately. Using Webjobs or something similar this is something that could be accomplished on top of Azure Storage, but there is nothing offered from the platform itself.

1

Since March 2019, this is possible with Lifecycle management support in Azure Blob Storage. See https://stackoverflow.com/a/57305518/347805

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)
Sarin
  • 1,255
  • 11
  • 14
0

In short, it is NOT POSSIBLE to make a blob auto-delete after a certain time by any setting/configuration on the blob itself in Azure at this time.

You will need to rely on other services such as Azure WebJobs or Azure Automation to automate such task.

juvchan
  • 6,113
  • 2
  • 22
  • 35