Azure Documentation

Azure Storage Account Lifecycle Management

Azure lifecycle management for storage accounts allows you to manage the data throughout its entire lifecycle. You can transition data to the most appropriate, and cost-effective, access tier for its usage patterns. For example, you can use the lifecycle management policy to:

This feature is supported for Azure Blob Storage and Azure Data Lake Storage Gen2 accounts.

Key Concepts

Creating a Lifecycle Management Policy

You can create lifecycle management policies using the Azure portal, Azure CLI, or Azure PowerShell.

Using the Azure Portal

  1. Navigate to your storage account in the Azure portal.
  2. In the left-hand menu, under Data management, select Lifecycle management.
  3. Click Add a rule to create a new rule.
  4. Configure the rule's scope (e.g., apply to all containers or specific ones).
  5. Define the conditions for the rule (e.g., age, date).
  6. Select the action(s) to perform (e.g., transition to cool, delete).
  7. Review and save the rule.

Azure CLI Example

To create a policy that transitions blobs older than 30 days to the cool tier and deletes blobs older than 365 days:


az storage lifecycle-management policy create --account-name <your-storage-account-name> --resource-group <your-resource-group> --rules '[
  {
    "name": "transition-to-cool",
    "type": "Lifecycle",
    "definition": {
      "actions": {
        "baseBlob": {
          "tierToCool": {
            "daysAfterModificationGreaterThan": 30
          }
        }
      },
      "filters": {
        "blobTypes": ["blockBlob"]
      }
    }
  },
  {
    "name": "delete-old-blobs",
    "type": "Lifecycle",
    "definition": {
      "actions": {
        "baseBlob": {
          "delete": {
            "daysAfterModificationGreaterThan": 365
          }
        }
      },
      "filters": {
        "blobTypes": ["blockBlob"]
      }
    }
  }
]'
        

Best Practices

Tip: Lifecycle management policies are executed once a day. Allow up to 24 hours for changes to take effect.

Further Reading