Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Azure Storage Account Lifecycle Management filter prefix for blobs in dynamically created sub-directories

So I have a quick question regarding filter prefixes related to lifecycle management for azure storage account V2.

So the scenario I’m faced with is that I have a blob directory/container which in turn contains sub directories created dynamically via a function that pushes/creates blobs depending on conditions, so the directories are created depending on that logic.

The problem I want to solve is that I want to delete the blobs after 7 days.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

In the documentation for lifecycle management it says that I can set a filter prefix for which container I want to apply the "retention rule" for, so to speak.

So the question related to what I’m trying to do is the following:

When setting the filter prefix for a blob container to: "containerName/",
as it says to do in the documentation will it also look in the subfolders?

In the Microsoft documentation it says:

"A prefix match string like container1/ applies to all blobs in the
container named container1."

Does that also include all the blobs in all the subfolders automatically. or do I have to specify each subfolder after the slash as it says further down in the same part of the documentation?

I would like to include all blobs in that first container regardless if they are in subfolders or not as the subfolders are created dynamically as mentioned before.

>Solution :

Does that also include all the blobs in all the subfolders
automatically. or do I have to specify each subfolder after the slash
as it says further down in the same part of the documentation?

Yes, when you set the prefix as container name, all blobs (including those in subfolders) will be considered thus you need not specify subfolders specifically.

You would specify subfolder in prefix only when you want to lifecycle management to manage blobs inside a specific subfolder.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading