Maximizing Efficiency with Azure Blob Storage Lifecycle Management

Introduction
Cloud storage is something more and more companies rely on and the need to optimize costs and ensure proper handling of data is critical for success. One way to achieve this is through lifecycle management in storage accounts, which lets us automate the process of moving and deleting data based on predefined rules.
This allows us to minimize storage costs and ensure that data is properly maintained over time.
Different types of data have different importance and usually the older a dataset is the need to access it reduces dramatically which in turn should prompt you to not want to pay as much in storage costs for it.
Configure lifecycle management
I will show you how to configure these settings here. You will need the following:
- An Azure Subscription
- A storage account
If you do not have a storage account you can create one by executing this AZ CLI command:
az storage account create \
--name mystorageaccount<randomnumber> \
--resource-group myResourceGroup \
--location westeurope \
--sku Standard_LRS \
--kind StorageV2
Head to the Azure Portal and search for the Storage Account you have created or is working with.
- In the left pane under Data Management select Lifecycle Management
- Select + Add a rule
- Enter a rule name, I gave mine deleteAfter10Days
- In my case I let the standard values be set under Rule scope, blob type & blob subtype but you can mix with this to fit your needs
- In my case I want to delete after 10 days so I changed the if-value to Created & 10 in More than (days ago)
- I let the then-value be Delete the blob but here you could use to to cool or archive storage
And you're done! You can probably imagine the amount of data laying around that has not been accessed for a long time that could probably be deleted or moved to archive storage to reduce costs.
In my example I delete all data 10 days after it has been created, this is a pretty harsh governance but this could be the use case for data that is only supposed to be stored there temporarily.
Reference

About the author
