How to add Blob Lifecycle Management rules in Azure


Azure Blob Storage offers Lifecycle Management to automate the movement of data between different access tiers (Hot, Cool, Archive) based on specified conditions, such as blob age or last access time.

This helps optimize storage costs by automatically transitioning blobs to more cost-effective storage tiers when they are less frequently accessed.

Here's a step-by-step guide to add Blob Lifecycle Management rules in Azure.

Step 1: Access Your Azure Storage Account

  1. Sign in to Azure Portal: Go to the .

  2. Navigate to Your Storage Account:

    • In the left sidebar, click on Storage accounts.

    • Select the storage account you want to configure lifecycle management for.

Step 2: Go to Blob Lifecycle Management Settings

  1. In your Storage Account blade, scroll down to the Data Management section.

  2. Click on Lifecycle management.

Step 3: Add a New Lifecycle Management Rule

  1. In the Lifecycle management pane, click on + Add rule to create a new lifecycle management rule.

Step 4: Define the Rule Settings

  1. Name the Rule: Provide a descriptive name for your rule (e.g., MoveOldBlobsToCool).

  2. Rule Scope:

    • Select whether the rule should apply to All blobs in the storage account or to specific Blob containers or Blob prefixes (e.g., certain file types or folders).

Step 5: Set Conditions for the Rule

In this step, you define the conditions that will trigger the lifecycle actions (e.g., moving blobs to a different tier, deleting them, etc.).

1. Blob Age

  • Choose to filter blobs based on creation date or last modified date.

  • For example, you might want to move blobs to the Cool tier if they are older than 30 days.

2. Blob Access (optional)

You can define rules to transition blobs based on their last access time.

For instance, move blobs to the Cool tier if they haven't been accessed in the last 60 days.

3. Other Conditions (optional)

You can use other conditions like blob type (BlockBlob, AppendBlob, PageBlob) or container if needed.

Step 6: Choose the Actions

Now, define what actions the rule should take once the conditions are met.

1. Move blobs to a different access tier

  • Move to Hot: Keep the blob in the Hot tier.

  • Move to Cool: Transition blobs to the Cool tier.

  • Move to Archive: Transition blobs to the Archive tier (for long-term, infrequently accessed storage).

Example: Move blobs older than 30 days to the Cool tier.

2. Delete blobs (optional)

You can also configure the rule to delete blobs after they reach a certain age or after a period of inactivity.

Step 7: Review and Create the Rule

  1. Review the settings of your lifecycle management rule.

  2. Click Create to apply the rule.

Example: Create a Rule to Move Old Blobs to Cool Tier

1. Rule Name

MoveBlobsToCool

2. Scope

Apply to all blobs in the storage account

3. Conditions

Age of blobs

Move blobs to Cool if they are older than 30 days.

Access condition

Blobs that have not been modified in the last 30 days will be eligible for transition.

4. Action

Move blobs to Cool tier after 30 days.

Step 8: Monitor and Edit Lifecycle Management Rules

Once your rule is created, it will automatically apply to the blobs that meet the defined conditions.

You can monitor the effectiveness of your rules and adjust them as needed.

1. View Applied Rules

Under the Lifecycle management pane, you can see a list of all your active rules and the status of their execution.

2. Edit Rules

If you need to modify a rule, click on the rule name and select Edit to adjust the settings.

Important Considerations

Retention Policy

For blobs moved to the Cool or Archive tiers, they need to stay in that tier for a minimum of 30 days.

If a blob is moved to the Cool or Archive tier and is deleted before 30 days, you'll be charged for the short retention period.

Transition to Archive

Blobs in the Archive tier take longer to access, and it may incur additional costs to rehydrate the data back to the Hot or Cool tier before it can be accessed.

Automated Deletion

You can automate the deletion of blobs after a certain retention period to free up storage space and save costs.

Summary

By setting up Lifecycle Management Rules in Azure Blob Storage, you can automate the management of your data based on its age, access patterns, and your cost optimization strategy.

This ensures that you don’t need to manually manage your data and helps save on storage costs by moving data to more cost-effective tiers based on its usage.

Related Articles


Rajnish, MCT

Leave a Reply

Your email address will not be published. Required fields are marked *


SUBSCRIBE

My newsletter for exclusive content and offers. Type email and hit Enter.

No spam ever. Unsubscribe anytime.
Read the Privacy Policy.