Auto deletion of files from blob container

Kalyan Gandham 110 Reputation points
2024-05-08T12:05:41.5466667+00:00

Hi Team,

wanted to check whether there is any way to auto-delete files inside azure container after certain (pre-set) time period?

Thanks

Kalyan

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,469 questions
0 comments No comments
{count} votes

Accepted answer
  1. Amrinder Singh 2,690 Reputation points Microsoft Employee
    2024-05-08T14:11:03.34+00:00

    Hi Kalyan Gandham - Thanks for reaching out.

    In order to manage the life cycle of the blob, below are the options ahead:

    • You can configure LCM policy and set the criteria however the value can be an integer value in number of Days.

    https://learn.microsoft.com/en-us/azure/storage/blobs/lifecycle-management-overview

    • There is another preview feature storage action using which you can configure the assignments and conditions. This however is a preview feature and not recommended for production. This is mainly for testing and sharing any feedback ahead.

    https://learn.microsoft.com/en-us/azure/storage-actions/storage-tasks/

    • You can write some kind of custom script to perform the deletion and have it scheduled via Azure Automation

    Please let us know if you have any further queries. I’m happy to assist you further.    


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Babafemi Bulugbe 1,955 Reputation points MVP
    2024-05-08T13:05:05.6466667+00:00

    Hello Kalyan Gandham,

    Thank you for posting your question in the Microsoft Q&A Community.

    I understand that you would like to know how to create an autodelete rule to delete old bolbs.

    This is possible with the Azure Blob storage lifecycle. Kindly take a look at the link below to get more information about this feature.

    https://learn.microsoft.com/en-us/azure/storage/blobs/lifecycle-management-policy-configure?tabs=azure-portal

    Lifecycle management base blobs page in Azure portal

    Let me know if this works.

    Babafemi