Storage costs add up when files stay in an expensive tier long after people stop using them. An Azure Storage lifecycle policy automates what happens next: it can move blobs between access tiers or delete them when they reach a specified age. The trade-off matters: cooler tiers can cost less to store but more to access. section 9.5.1
Move aging files
For a storage account holding books, a JSON rule targets block blobs and moves them to the cool tier more than 30 days after modification, then to archive after 90 days. It also deletes them after 365 days—but if those books must be kept, leave out the delete action. The rule is saved to a file and applied to the storage account with `az storage account management-policy create`. section 9.5.1
{
"rules": [
{
"name": "TransitionHotToColdToArchive",
"enabled": true,
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToCool": {
"daysAfterModificationGreaterThan": 30
},
"tierToArchive": {
"daysAfterModificationGreaterThan": 90
},
"delete": {
"daysAfterModificationGreaterThan": 365
}
}
},
"filters": {
"blobTypes": [
"blockBlob"
]
}
}
}
]
}
The JSON listing shows how one enabled rule combines blob-type filters with tier-transition and deletion actions. section 9.5.1
Version tracking creates another cleanup job: old versions can accumulate even when the current blobs are managed. A separate rule can delete blob versions more than 90 days after creation. Do not apply its JSON file as a replacement for the first policy: doing so overwrites that policy. Put both rules in one `rules` array, apply the combined file, then check the result with `az storage account management-policy show`. section 9.5.2


