Skip to content
Back to Blog
1 min read

Azure Blob Storage Lifecycle Management

I wrote “Azure Blob Storage Lifecycle Management” to share practical, production-minded guidance on this topic.

Storage Tiers

TierAccessCost (per GB)Use Case
HotFrequent$0.0184Active data
CoolInfrequent$0.01Backup, 30+ days
ArchiveRare$0.00099Compliance, years

Lifecycle Policy

{
  "rules": [
    {
      "name": "MoveToArchive",
      "enabled": true,
      "type": "Lifecycle",
      "definition": {
        "filters": {
          "blobTypes": ["blockBlob"],
          "prefixMatch": ["logs/", "backups/"]
        },
        "actions": {
          "baseBlob": {
            "tierToCool": {"daysAfterModificationGreaterThan": 30},
            "tierToArchive": {"daysAfterModificationGreaterThan": 90},
            "delete": {"daysAfterModificationGreaterThan": 365}
          }
        }
      }
    },
    {
      "name": "DeleteOldSnapshots",
      "enabled": true,
      "type": "Lifecycle",
      "definition": {
        "filters": {
          "blobTypes": ["blockBlob"]
        },
        "actions": {
          "snapshot": {
            "delete": {"daysAfterCreationGreaterThan": 90}
          }
        }
      }
    }
  ]
}

Applying the Policy

az storage account management-policy create \
    --account-name mystorageaccount \
    --resource-group myrg \
    --policy @lifecycle-policy.json

Cost Savings Example

1TB of logs per month:

  • All Hot: $184/month × 12 = $2,208/year
  • With lifecycle (30d hot, 60d cool, archive): ~$500/year

Savings: $1,700/year for 1TB

Considerations

  • Archive retrieval: Takes hours, costs extra
  • Cool minimum: 30-day minimum storage duration
  • Version considerations: Policies can apply to versions too

Set up lifecycle policies on day one. Future you will thank past you for the cost savings.\n\n## Takeaways\n\nAdd a concise, personal takeaway and recommended next steps here.\n

Michael John Peña

Michael John Peña

Senior Data Engineer based in Sydney. Writing about data, cloud, and technology.