简体   繁体   中英

Azure Storage - Data Lake Lifecycle Management question

Using a lifecycle management policy to move the contents of a container to archive from cool access tier.I'm trying the following policy in the hopes that it will move all files in that container to archive tier after one day but it's not working. I've set the selection criteria "after one day of not being used".

Here's the json code: { "rules": [ { "enabled": true, "name": "move to cool storage", "type": "Lifecycle", "definition": { "actions": { "baseBlob": { "tierToArchive": { "daysAfterLastAccessTimeGreaterThan": 1 } } }, "filters": { "blobTypes": [ "blockBlob" ], "prefixMatch": [ "/amcont1" ] } } } ] }

I'm checking the container after one day and two days and nothing has changed, the access tier still remains the same, cool instead of archive. Is there a way to test this interactively?

You also need to give the container name in "prefixMatch" value to implement the rule.

在此处输入图像描述

Try the below given rule and check the result. Change the values as per your storage account. This should work fine.

{
  "enabled": true,
  "name": "last-accessed-one-day-ago",
  "type": "Lifecycle",
  "definition": {
    "actions": {
      "baseBlob": {
        "tierToArchive": {
          "daysAfterLastAccessTimeGreaterThan": 1
        }
      }
    },
    "filters": {
      "blobTypes": [
        "blockBlob"
      ],
      "prefixMatch": [
        "mycontainer/logfile"
      ]
    }
  }
}

Refer: Move data based on last accessed time

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM