Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (4k points)
Is there any particular way to configure a time period for the containers such that the contents are discarded after that particular time period?

1 Answer

0 votes
by (9.6k points)
edited by

Azure Blob Storage does not support any such feature at the moment. But, you can develop your own code to do the needful. 

Few tips when it comes to developing the code:

  1. A few Azure storage SDKs can be used to carry out basic functionalities like deleting blobs. They are available in multiple languages. 
  2. You will have to schedule the code. It may be on a daily basis. Azure web jobs are one such service provided by Azure that may be helpful. 

Here is a snippet of code that may be useful:

{
  "version": "0.5",
  "rules": [
    {
      "name": "expirationRule",
      "type": "Lifecycle",
      "definition": {
        "filters": {
          "blobTypes": [ "blockBlob" ]
        },
        "actions": {
          "baseBlob": {
            "delete": { "daysAfterModificationGreaterThan": 30}
          }
        }
      }
    }
  ]
}
And also check out Intellipaat's Azure Training and become an Azure expert

Browse Categories

...