Share via

Azure Blob Lifecycle Management Rule Not Deleting Blobs as Expected

Luana Chavez 20 Reputation points
Oct 24, 2024, 12:39 PM

Hello Azure Support Team,

I have configured a lifecycle management rule in my Azure Storage account to delete blobs based on their creation date. The rule is set up with the following configuration:

  • Blob Prefix Filter: diff-sqlserverbackupsohv/DiffBackup_
  • Blob Types: Block blobs and Append blobs
  • Blob Subtype: Base blobs
  • Condition: Delete base blobs that are older than 1 day.

The rule is supposed to delete any blobs with the prefix DiffBackup_ that are older than one day. However, I noticed that a blob named DiffBackup_EMP_AQUA_20241022_10.bak, created on 22/10/2024 at 9:59:48 AM, has not been deleted even though it is now 24/10/2024 at 08:22 AM—more than 24 hours have passed.

I would like to understand why the blob has not been deleted yet. Here are some specific details:

  • The rule configuration has been verified and appears correct.
  • The blob creation date has been confirmed, and it meets the condition to be deleted.
  • I have checked the lifecycle policy settings, and everything seems to be in order.

Could you please help me investigate this issue and ensure that the lifecycle rule is being applied correctly?

Thank you for your assistance.

Best regards,

Luana

Azure Storage Explorer
Azure Storage Explorer
An Azure tool that is used to manage cloud storage resources on Windows, macOS, and Linux.
278 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,393 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,100 questions
0 comments No comments
{count} votes

Accepted answer
  1. Hari Babu Vattepally 1,725 Reputation points Microsoft Vendor
    Oct 24, 2024, 5:52 PM

    Hi @Luana Chavez

    Greetings! Welcome to Microsoft Q&A Forum and Thank you for posting your query.

    There doesn't appear to be an issue with the rule you created. Did you recently create or modify the rule? It can take up to 24 hours for actions to run the first time and up to 48 hrs to complete if the policy was updated. The rule you have created is only for the Block blobs and Append blobs. Double check that the blobs you are seeing are not snapshots or versions and are indeed block blobs.

    Note: Keep in mind that a lifecycle management policy will not delete the current version of a blob until any previous versions or snapshots associated with that blob have been deleted. If blobs in your storage account have previous versions or snapshots, then you should select Base blobs, Snapshots, and Versions in the Blob Subtype section when you are specifying a delete action as part of the policy.

    • If the blobs are created before the creation of the lifecycle management rule they will not be deleted.
    • To apply policy for existing blobs, you can move or copy them to a new container where the policy will be applied.
    • Make sure If you are updating or new policy it may take up to 48Hrs to complete.
    • Ensure that the blobs you trying to delete match the prefix "queryresults" as same as in the specified policy.
    • Also check if any restriction is applied to a container or blob like Immutablity policy and the blob is leased.

    The delete action of a lifecycle management policy won't work with any blob in an immutable container. With an immutable policy, objects can be created and read, but not modified or deleted. For more information, see Store business-critical blob data with immutable storage.

    Depending on the size and the number of objects that are in a storage account, more than one run might be required to process all of the objects. You can also check the storage resource logs to see if the operations are being performed by the lifecycle management policy.

    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.

    Please refer Optimize costs by automatically managing the data lifecycle - Azure Storage | Microsoft Docs for more information. User's image

    If the issue still persists, please let me know I would like to work closer on this issue.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


1 additional answer

Sort by: Most helpful
  1. Luana Chavez 20 Reputation points
    Oct 24, 2024, 6:47 PM

    Hi,

    The "Support and Troubleshooting Diagnostic" did not detect any issues with the existing lifecycle management policies. The container and prefix are correctly configured, and they match the blob type and status as well. However, the policy is still not reflecting any deletions as expected.

    Rule Configuration:

    • Rule Name: DeleteOldDiffBackups
    • Scope: Limited to blobs with filters.
    • Blob Types: Block blobs and Append blobs.
    • Blob Subtype: Base blobs (not snapshots or versions).
    • Prefix: diff-sqlserverbackupsohv/DiffBackup_
    • Condition: Delete base blobs older than 1 day.

    Blob Information:

    The blob we are expecting to be deleted is:

    • Name: DiffBackup_EMPRESA_ESFERA_20241022_10.bak
    • Last Modified: October 22, 2024, 9:59:24 a.m.
    • Creation Time: October 22, 2024, 9:59:23 a.m.
    • Lease Status: Unlocked.
    • Lease State: Available.

    The blob's prefix, type (block blob), and other settings are fully aligned with the rule configuration. The lifecycle management policy was created on October 22, 2024, but as of today, October 24, 2024, the deletions for older blobs (specifically from October 22, 2024, at 10:00 a.m.) have not occurred.

    Could you please assist in diagnosing why the deletions are not being applied, and if there are any delays or specific actions required to trigger the process?

    Thank you for your help. Hello Support Team,

    The "Support and Troubleshooting Diagnostic" did not detect any issues with the existing lifecycle management policies. The container and prefix are correctly configured, and they match the blob type and status as well. However, the policy is still not reflecting any deletions as expected.

    Rule Configuration:

    • Rule Name: DeleteOldDiffBackups
    • Scope: Limited to blobs with filters.
    • Blob Types: Block blobs and Append blobs.
    • Blob Subtype: Base blobs (not snapshots or versions).
    • Prefix: diff-sqlserverbackupsohv/DiffBackup_
    • Condition: Delete base blobs older than 1 day.

    Blob Information:

    The blob we are expecting to be deleted is:

    • Name: DiffBackup_EMPRESA_ESFERA_20241022_10.bak
    • Last Modified: October 22, 2024, 9:59:24 a.m.
    • Creation Time: October 22, 2024, 9:59:23 a.m.
    • Lease Status: Unlocked.
    • Lease State: Available.

    The blob's prefix, type (block blob), and other settings are fully aligned with the rule configuration. The lifecycle management policy was created on October 22, 2024, but as of today, October 24, 2024, the deletions for older blobs (specifically from October 22, 2024, at 10:00 a.m.) have not occurred.

    Could you please assist in diagnosing why the deletions are not being applied, and if there are any delays or specific actions required to trigger the process?

    Thank you for your help.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.