Exploring Azure Storage Actions for Blob Storage

John Kilmister, ยท 4 min read

Blob Lifecycle Management allows us to set rules to automatically manage the tiers of our blobs in Azure Storage. Recently, however, Microsoft has announced a public preview of Azure Storage Actions. This feature takes this same concept much further with a wider range of rule triggers and blob-based operations that go well beyond tier changes, all through the use of a new resource type.

In this post, we will take a look at the Azure Storage Actions feature, comparing it to the current Lifecycle Management. It is worth noting that at the time of writing during the preview, this is only available in two Azure regions, France Central and Canada Central.

Storage Tasks

Unlike with the Lifecycle Management feature, to start working with Storage Actions you do not start in the Storage Account but by creating a new Storage Task resource.

Screenshot of the finding storage task

When we create a Storage Task, we are provided a visual editor that allows us to define the rules that look similar to what you may be used to. These rules are much more expansive than the Lifecycle Management rules and include the ability to trigger based on the delete state, version, content length, tags, name, and much more.

We can also combine multiple conditions, something not available with Lifecycle Management. The option to filter blobs based type is done here however filters based on the name are done later in the assignment process.

Screenshot of the condition in the storage task

Once we have set the condition we can then set the operation to perform. Once again this is also much more flexible than the Lifecycle Management rules. We can still delete the blob and update the tier, however, we can now also set the tags, un-delete, and set the immutability policy.

Screenshot of the action in a storage task

The Storage Task allows for multiple operations to be performed based on the condition. You can also optionally configure a group of Else operations for items that do not meet the condition. These give a lot of flexibility to how you may configure your Storage Task.

Screenshot of the else feature of the storage task

More details can be found in the official preview documentation

Assignment

We need to attach the Storage Task resource to a Storage Account for it to take effect. This is done through the assignment process and can be done as part of creating the task, or later from inside the Storage Account.

It is the assignment that defines any blob prefix filters and the schedule for how often the task is run.

Screenshot of the else feature of the storage task

The assignment process means we can attach the same tasks to multiple Storage Accounts and have them run on different schedules. Assignments on each Storage Account can also be enabled and disabled as needed.

More details can be found in the official preview documentation

Run

The runs are based on the schedule set in the assignment. There is no way at this time to force an immediate or ad-hoc run. There are several ways to monitor the run history. After each run a report is generated and added to the Report export container set at the time of assignment. You can also use Azure metrics to monitor the successful and failed runs along with metrics around the number of objects targeted. A history of the run is shown in both the storage task and the Storage Account.

These features give a lot more transparency than the Lifecycle Management rules, in which you can not control the schedule or see when it has been run, hopefully allowing you to help diagnose any issues quicker.

Preview Limits and Notes

As with any public preview, there are restrictions. In the case of Azure Storage Actions, at the time of writing the main restriction is that it is limited to Storage Accounts in France Central or Canada Central only.

From my testing, the assignment only worked on Storage Accounts that had hierarchical namespaces enabled. I could not however find any notes on this in the documentation.

The pricing model has also not yet been announced, however, at the time of writing, the feature is free to use during the trial.

Conclusion

Azure Storage Actions, currently in preview in two locations share all of the same features as the Lifecycle Management rules but with a much more expansive set of customizations, conditions, and operations.

The same storage action can be applied to multiple Storage Accounts with custom schedules and when the actions are run a report is generated.

These are a huge improvement upon Lifecycle Management which was already a powerful feature. I look forward to seeing this feature come out of the preview and seeing the pricing model.

For more information on Azure Storage Actions, see the official documentation

Title Photo by Alexas_Fotos on pixabay

Recent and Related Articles