none
Pattern matching with lifecycle managment RRS feed

  • Question

  • Is it possible to use pattern matching with lifecycle management, I'd like to define a rule that looks like this.

    "filters": {
    "blobTypes": [
    "blockBlob"
    ],
    "prefixMatch": [
    "*/Versions"
    ]
    }
    Tuesday, August 27, 2019 8:42 AM

Answers

  • Hi DaveB1812, 

    Pattern matching is currently supported, but very limited(no regex support), however, you use the prefixMatch parameter to set specific rules, for example if you want to match blobs within https://myaccount.blob.core.windows.net/container1/foo/..

    you will have to include the following prefixMatch: container1/foo, below is a json example:

    {
      "rules": [
        {
          "name": "agingRule",
          "enabled": true,
          "type": "Lifecycle",
          "definition": {
            "filters": {
              "blobTypes": [ "blockBlob" ],
              "prefixMatch": [ "container1/foo", "container2/bar" ]
            },
            "actions": {
              "baseBlob": {
                "tierToCool": { "daysAfterModificationGreaterThan": 30 },
                "tierToArchive": { "daysAfterModificationGreaterThan": 90 }
              }
            }
          }
        }
      ]
    }

    you can find more information here: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-lifecycle-management-concepts

    Let me know if this helps.

    Thanks,

    Adam

    Wednesday, August 28, 2019 9:39 PM
    Moderator

All replies

  • Thank you for raising this question! We are checking on this internally and will get back to you soon.

    Wednesday, August 28, 2019 5:05 AM
    Moderator
  • Hi DaveB1812, 

    Pattern matching is currently supported, but very limited(no regex support), however, you use the prefixMatch parameter to set specific rules, for example if you want to match blobs within https://myaccount.blob.core.windows.net/container1/foo/..

    you will have to include the following prefixMatch: container1/foo, below is a json example:

    {
      "rules": [
        {
          "name": "agingRule",
          "enabled": true,
          "type": "Lifecycle",
          "definition": {
            "filters": {
              "blobTypes": [ "blockBlob" ],
              "prefixMatch": [ "container1/foo", "container2/bar" ]
            },
            "actions": {
              "baseBlob": {
                "tierToCool": { "daysAfterModificationGreaterThan": 30 },
                "tierToArchive": { "daysAfterModificationGreaterThan": 90 }
              }
            }
          }
        }
      ]
    }

    you can find more information here: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-lifecycle-management-concepts

    Let me know if this helps.

    Thanks,

    Adam

    Wednesday, August 28, 2019 9:39 PM
    Moderator
  • Is there any update on the issue?

    If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.

    Friday, August 30, 2019 4:26 AM
    Moderator
  • @Daveb1812 Is there any update on the issue?

    If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.

    Wednesday, September 4, 2019 5:16 AM
    Moderator
  • @Daveb1812  Is there any update on the issue?

    If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.

    Saturday, September 7, 2019 6:29 AM
    Moderator