Enterprises use Service Bus resources, Event Hubs, Storage accounts and many other Azure services to build a solution to solve a business problem. As a part of integrating these services together, it may be needed to store events, messages or other data into Storage Account Blobs. These stored blob content might not be of use after a time. Hence removing unwanted content from Azure Storage Blob becomes a business need.
This capability is not found both in the Azure portal and in the Storage Explorer. Serverless360 fills this gap with a capability to automate the process of clearing contents from Storage Account Blobs.
Consider a scenario where an application listens for messages from a Service Bus Queue or Topic Subscription and writes the messages as Page or Block blobs into a Storage Account Blob. This continuous writing of messages into the blobs will cause a drastic increase in the number of blobs inside the Storage Account Blob Container. Unlike Service Bus Queue where the messages would be removed from the Queue when the Application receives it, the blobs would retain the content even after the application had done processing it. In this scenario the blobs older than 10 days in the blob storage is no more required for the Business. Manual deletion of these old blobs is a tedious task.
Serverless360 solves this problem by providing automated tasks to delete the old blobs in Storage Account Container.
Delete Old Blobs in a Storage Account Container
The blobs can be deleted either through inline or scheduled automated task based on the business requirement. Purging blobs can be done by specifying at least one of the following conditions
- Blob Created time
- Blob Modified time
- Blob Type
- Blob Name constraints
The Blob Type is set to All by default.
Only those blobs that aren't Leased will be deleted.
All the Snapshots of the blobs will be deleted.
Delete old blobs through scheduled automated task
If the process of deleting the old blobs is repetitive, then scheduled automated task is the best choice. This automated task can be scheduled to run on daily or hourly basis.
Deleting Blobs based on Created/Modified time
In this case, users can specify the time duration so that the blobs created or modified (last accessed) before the specified time duration from which the automated task runs will be deleted.
Deleting Blobs based on name constraints
For purging Storage blobs based on blob name, user can specify the name conditions and the blob will be automatically purged by the Automated Task when the conditions are met.
Choose a condition from the available conditions in the drop down and set the value to be checked. Users can even add more than one condition.