Emmie
Emmie

Reputation: 796

Azure storage lifecycle management delete append blob is not deleting

Recently append blob is supported for azure storage lifecycle management. I implemented to delete all items in a specific container after 20 days of last modification. I followed this documentation. However I tested several ways, and waited every time for more than 48 hours, it is not deleting the blobs. Perhaps I am overlooking something. This is the setup:

I have a blob container which is called logs. In logs I have append blobs. Everything in this container that is more than 20 days ago modified should be delete.

enter image description here

This is the code view of what I last tried.

{
  "rules": [
    {
      "enabled": true,
      "name": "PurgeLogData",
      "type": "Lifecycle",
      "definition": {
        "actions": {
          "baseBlob": {
            "delete": {
              "daysAfterModificationGreaterThan": 20
            }
          }
        },
        "filters": {
          "blobTypes": [
            "appendBlob"
          ],
          "prefixMatch": [
            "logs/20"
          ]
        }
      }
    }
  ]
}

What I already tried for the prefix match is:

Can someone tell me what I am doing wrong? I am running out of ideas how it should be working.

Upvotes: 1

Views: 1821

Answers (1)

Ivan Glasenberg
Ivan Glasenberg

Reputation: 29950

Checked the rules in your question, it's ok. To delete all blobs in a container, you can just specify the container name for prefixMatch. For example:

"prefixMatch": [
            "logs"
          ]

Here are something you need to check:

1.Are you applying some limitations for the container or blobs? eg. are there any immutability policies or blob leased?

2.Make sure you're waiting at least 24 hours.

3.For testing purpose, you can create a new container, upload some append blobs, then set lifecycle management rules to delete these blobs after 1 day. I tested it at my side, it can work well.

Upvotes: 1

Related Questions