Blob Lifecycle management

Akash Gaikwad 0 Reputation points
2023-03-27T08:12:42.16+00:00

Hi Team,

I have created a Blob lifecycle rule that delete the blobs after 90 days of its modification, and working fine now the issue is can we add scheduled time so the lifecycle will run on specific decide time.

like 12.00 am UTC lifecycle should run once in a day.

if yes then please let us know.

rule:

{
  "rules": [
    {
      "enabled": true,
      "name": "DeleteBlobRule",
      "type": "Lifecycle",
      "definition": {
        "actions": {
          "baseBlob": {
            "delete": {
              "daysAfterModificationGreaterThan": 30
            }
          }
        },
        "filters": {
          "blobTypes": [
            "blockBlob",
            "appendBlob"
          ]
        }
      }
    }
  ]
}
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,090 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,780 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sedat SALMAN 13,735 Reputation points
    2023-03-27T08:16:23.73+00:00

    The Azure Blob Storage lifecycle management does not allow you to schedule rule execution at a specific time of day. The lifecycle management runs in the background on a regular basis, and it usually takes effect within 24 hours of the specified condition being met.

    In your case, the rule you've created will delete blobs 90 days after they've been modified. When a blob reaches this age, the lifecycle management process deletes it within the next 24 hours.

    If you need more control over when the blobs are deleted, you can implement a custom solution using Azure Functions or Logic Apps, which can be scheduled to run at specific times. In this case, you'd need to create a script that lists the blobs, checks their ages, and deletes them if the specified ages are met. The script can then be scheduled for execution using the scheduling capabilities provided by Azure Functions or Logic Apps.

    0 comments No comments

  2. 2023-03-31T18:47:31.0666667+00:00

    Unfortunately, there's no way to track the time at which the policy will be executing, as it's a background scheduling process. However, the platform will run the policy once per day.

    please refer FAQ section in this document for more information about blob life cycle management policy.

    https://learn.microsoft.com/en-us/azure/storage/blobs/lifecycle-management-overview#is-there-a-way-to-identify-the-time-at-which-the-policy-will-be-executing

    0 comments No comments

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.