Azure Storage Lifecycle Administration

Harsh Bakshi
4 min readDec 1, 2023

Every enterprise gathers totally different sorts of datasets for our necessities in regular day-to-day operations. Every dataset has a novel lifecycle. Few entry some knowledge typically however generally the necessity for entry typically drops drastically as the info we maintain ages. Some knowledge stays idle within the cloud and is never accessed as soon as saved. Some knowledge units expire days or months after creation, whereas different knowledge units are actively learn and modified all through their lifetimes.

To handle the info which are getting saved in our Azure storage, Azure offers a function known as “Lifecycle Administration” that lets you outline insurance policies to routinely handle the lifecycle of blobs in your storage account. This contains deleting or archiving/shifting blobs based mostly on circumstances equivalent to their age or whether or not they have been modified.

To routinely delete outdated information from an Azure Storage account utilizing a lifecycle coverage, observe these steps:

  • Navigate to your Azure Storage account: Log in to the Azure Portal and go to your Azure Storage account.
  • Entry Lifecycle Administration Service: Inside your storage account, Within the Blob service part, search for “Lifecycle administration” or “Administration” choices.
Azure Storage Lifecycle Management Image
  • Configure Lifecycle Administration:
  • Create a brand new rule or coverage for managing the lifecycle of blobs by clicking on the ‘Add a rule’ button.
  • Specify a rule title. I’ve set the rule title as testlifecyclerule.
  • For this demo, I’m choosing the rule scope to filter blobs, you possibly can see a brand new tab known as ‘Filter set’ added after getting chosen it.
Azure Storage Lifecycle Management Configuration

Lifecycle administration coverage won’t delete the present model of a blob till any earlier variations or snapshots related to that blob have been deleted. If blobs in your storage account have earlier variations or snapshots, then you must choose Base blobs, Snapshots, and Variations within the Blob Subtype part if you find yourself specifying a delete motion as a part of the coverage.

  • Outline a Rule:
  • Select the kind of motion you need to carry out (e.g., Delete).
  • Outline the circumstances for the rule, such because the age of the blob or a particular prefix.
Azure Storage Lifecycle Management Rule Definition

Within the filter tab, I’ve specified to take away solely the information that begin with the alphabet ‘F’ current below the folder named ‘s3files’.

Azure Storage Lifecycle Management Filter
  • Save the Coverage: Save the coverage, and it’ll take impact based mostly on the circumstances you specified.

This is a basic instance of what the configuration may appear like:

  • Rule Title: testlifecyclerule
  • Motion: Delete
  • Filter:
  • Rule to delete blobs older than 300 days.
  • Optionally, you possibly can specify a prefix or different circumstances to focus on particular blobs.

As soon as configured, Azure Storage will routinely apply the lifecycle administration coverage, and blobs that match the desired circumstances shall be deleted.

Earlier than the rule was executed

Before Lifecycle Management Rule Execution

The beneath picture is taken as soon as after the lifecycle rule was executed efficiently. We might see that as per our filter situation, out of the three information beginning with the alphabet ‘F’ which was final modified (2 information) greater than 300 days have been deleted.

After Lifecycle Management Rule Execution

It is necessary to notice a number of issues:

  • Lifecycle insurance policies might take a while to take impact, as they’re processed within the background by Azure Storage, many instances it would take as much as 48 hours to finish.
  • If the blobs are created earlier than the creation of the lifecycle administration rule they won’t be deleted.
  • To use coverage for current blobs, you possibly can transfer or copy them to a brand new container the place the coverage shall be utilized.

Utilizing Azure Storage lifecycle insurance policies is commonly a less complicated and extra automated option to handle the lifecycle of your blobs in comparison with customized code options.

Conclusion

Lifecycle insurance policies are a strong function, and you must fastidiously evaluate the Azure Storage documentation for detailed data and greatest practices. Be cautious when organising insurance policies to make sure you do not inadvertently delete necessary knowledge.

Know extra about our firm at Skrots. Know extra about our companies at Skrots Providers, Additionally checkout all different blogs at Weblog at Skrots


Know more about our company at Skrots. Know more about our services at Skrots Services, Also checkout all other blogs at Blog at Skrots

Thanks, Harsh
Founder | CEO — Skrots

Learn more about our blog at Blog at Skrots. Checkout our list of services on Skrots. Give a look at our website design at Skrots . Checkout our LinkedIn Page at LinkedIn.com. Check out our original post at https://blog.skrots.com/azure-storage-lifecycle-management/?feed_id=1644&_unique_id=656a541c25bae

--

--