Azure blob Storage Life Cycle Management not working over 48hours

単ルイ(Shan Rui) 130 Reputation points
2023-05-12T02:43:35.45+00:00

he lifecycle rule has been created for over 24 hours, it should have taken effect by now.

But Block Blob has not been deleted.
There is my lifecycle rule.

{

  "rules": [
    {

      "enabled": true,

      "name": "GitHubNotMainBranch",

      "type": "Lifecycle",

      "definition": {

        "actions": {

          "baseBlob": {

            "delete": {

              "daysAfterModificationGreaterThan": 1

            }

          }

        },

        "filters": {

          "blobTypes": [

            "blockBlob"

          ],

          "prefixMatch": [

            "test-artifacts/back1.0/develop/[[[other]]]_"

          ]

        }

      }

    }

  ]

}
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,425 questions
{count} votes

Accepted answer
  1. Sumarigo-MSFT 43,411 Reputation points Microsoft Employee
    2023-05-16T06:10:00.24+00:00

    単ルイ(Shan Rui) Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    Things to check: 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 base blobs and block 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 person found this answer helpful.

0 additional answers

Sort by: Most helpful