Menu

Post image 1
Post image 2
1 / 2
0

Automatically deleting blobs in Azure Blob Storage

DEV Community·evdbogaard·20 days ago
#Ocw7S0yJ
#azure#blob#lifecyle#csharp#rule#blobs
Reading 0:00
15s threshold

Recently I worked on a task where I needed to remove uploaded blobs after a certain amount of time. My mind immediately went to Azure Blob storage lifecycle management , but the problem appeared to be a bit more nuanced than I first thought. With lifecycle management you can define rules that automatically perform actions on blobs. Each rule consists of conditions, actions, and filters. Conditions : Specify if the rule applies based on when a blob was created, last modified, or last accessed. Actions : Specify which action to apply. This can be changing the blob's tier or deleting it. Filters : Limits the rule to a subset of blobs. By default it applies to all blobs, but filters allow for filtering for certain tags or prefixes. A common use case is to automatically clean up temporary data. You'd create a rule that filters on a prefix like tmp/ , set a condition to match blobs that haven't been modified in 30 days, and set the action to delete.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More