We have a requirement to delete the files after certain days from storage container folders.
I have set a rule to delete them as per below. But looks like this rule is not getting triggered. Please advice.
"rules": [
{
"enabled": true,
"name": "test",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"delete": {
"daysAfterModificationGreaterThan": 1
}
}
},
"filters": {
"blobTypes": [
"blockBlob"
],
"prefixMatch": [
"raw / BV/ landing / BV-data-to-Data-Lake-Integration/events",
"raw / BV/ landing / BV-data-to-Data-Lake-Integration/event_",
"raw / BV/ landing / BV-data-to-Data-Lake-Integration/sensors"
]
}
}
}
]
}````
I tried to reproduce the same in my environment and I got the result successfully:
I have set a rule to delete them as per below. But looks like this rule is not getting triggered.
48Hrs
to complete.Portal:
Code view:
"rules": [
{
"enabled": true,
"name": "rule1",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"delete": {
"daysAfterModificationGreaterThan": 1
}
}
},
"filters": {
"blobTypes": [
"blockBlob"
],
"prefixMatch": [
"test/folder1/scores.json",
"test1/folder1/file.json"
]
}
}
}
]
}
Also check the any restrictions in place for the container or the blobs like Immutability policies or the blob is leased.
Reference: azure - Lifecycle management rule not working for ADLS Gen2 Storage Account - Stack Overflow by Joel Cochran.