Reputation: 91
We are considering moving archived data after some retention period to the newer cool
tier of Azure Storage (https://azure.microsoft.com/en-us/blog/introducing-azure-cool-storage/).
Can I programatically set up something that will automatically change the tier or move content to a cool tier storage after some period of time?
Upvotes: 6
Views: 7073
Reputation: 155638
Can I programmatically set up something that will automatically change the tier or move content to a cool tier storage after some period of time?
Yes, (since August 2021) it's now possible to have Azure automatically move blobs between Hot, Cool, and Archive tiers - this is done using a Lifecycle management policy which you can configure.
This is documented in this page: https://learn.microsoft.com/en-us/azure/storage/blobs/lifecycle-management-overview
Some caveats:
You can't force-run a policy: once you've set-up the policy you'll simply have to wait... up to 48 hours or even longer.
Your blobs need to be readable by Azure itself, so this won't work with super secure or inaccessible storage accounts.
You need to enable blob access-tracking first (I describe how to do this in the section below).
The policy rules you can create are somewhat restrictive as you can only filter the set of blobs to auto-archive or automatically move to the Cool tier based on only these parameters:
The only possible rule actions are to move blobs between tiers or to delete blobs. You can't move blobs between containers or accounts or edit any blob metadata or change a blob's access-policy and so on...
To set up a blob lifecycle policy to automatically move Hot blobs to the Cool tier if not accessed for 90 days (as an example), do this:
(Azure Portal screenshots taken as I wrote this, in August 2022 - if the screenshots or instructions are outdated leave a comment and I'll update them)
Open the Azure Portal (https://portal.azure.com) and navigate to your Storage Account's "blade".
Look for "Lifecycle Management" in the sidebar:
Click "Add a rule" and complete the wizard:
move-blobs-not-accessed-for-90-days-to-cool-tier
tierToCool
), move-to-archive (tierToArchive
), and delete-blob (delete
).And that's it - so now you have to wait up to 48 hours for the policy to start to take effect, and maybe wait even longer for Azure to actually finish moving the blobs between tiers.
Upvotes: 3
Reputation: 3293
In additional, we can change the Blob Storage characteristic at any point. But when change from cool to hot, you have to pay for a lot of I/O for converting the blob type. Converting from hot to cool is free. We could find more details at this document.
Upvotes: 2