Lifecycle Management Policy
An Azure Storage lifecycle management policy is a set of rules that automatically moves blobs between access tiers or deletes them based on age or last access. It is the main cost-control tool for blob storage that cools over time.
Lifecycle Management Policy
A rule matches blobs by container, name prefix, or blob index tags, then applies actions after a number of days. A typical rule moves blobs to Cool after 30 days, Cold after 90, Archive after 180, and deletes them after two years. The policy engine runs in the background about once a day, so changes are not instant.
What Triggers a Tier Change?
Conditions are based on days since last modification, days since creation, or days since last access. Last-access conditions only work if you enable last-access-time tracking on the account, which is off by default.
How Do You Apply a Policy?
az storage account management-policy create \ --account-name mumbaiprodstorage --resource-group mumbai-prod-rg \ --policy @lifecycle-policy.jsonThe policy file holds rules with tierToCool, tierToCold, tierToArchive, and delete actions, each with a daysAfterModificationGreaterThan or daysAfterLastAccessTimeGreaterThan threshold.
Why It Matters in Production
A trading platform like Zerodha can age audit logs from Hot to Cool to Archive automatically, cutting storage cost substantially over a year without anyone moving blobs by hand.
Common MistakeArchiving data that is read occasionally. Rehydration takes hours and costs money, and deleting before the minimum retention period (Cool 30, Cold 90, Archive 180 days) adds an early-deletion charge.
RememberModification-based rules never fire for a blob that is rewritten often, because each write resets its age.
Frequently Asked Questions
How long does a new lifecycle policy take to run?
Changes can take up to 24 hours to take effect, and the engine then evaluates blobs once per day, so do not expect instant tiering.
Can a policy move data back to Hot?
With last-access-time tracking and the `enableAutoTierToHotFromCool` option, a Cool blob that is read can move back to Hot automatically. Archive blobs always need explicit rehydration.
Can I scope a rule to part of a container?
Yes. Use prefix match filters such as `audit-logs/2026/` or blob index tags to limit which blobs a rule touches.