I have a storage account and inside that I have container "mycontainer"
I have two virtual folders preview and final
I want to configure life cycle rule to delete all blobs from preview folder which is created a day ago along with that I want to configure another rule that deletes all blobs from final which is created a day ago, only if the blob has an index tag "candelete" : "true"
When I tried configuring Lifecycle rule, it get deletes blobs from preview, but not from final
My rules looks like
{
"rules": [
{
"enabled": true,
"name": "deletepreview",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"delete": {
"daysAfterCreationGreaterThan": 1
}
}
},
"filters": {
"blobTypes": [
"blockBlob"
],
"prefixMatch": [
"mycontainer/preview"
]
}
}
},
{
"enabled": true,
"name": "deletefinal",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"delete": {
"daysAfterCreationGreaterThan": 1
}
}
},
"filters": {
"blobIndexMatch": [
{
"name": "candelete",
"op": "==",
"value": "true"
}
],
"blobTypes": [
"blockBlob"
],
"prefixMatch": [
"mycontainer/final"
]
}
}
}
]
}
Blob Lifecycle Management
I have created blob1 container having t1 and t2 folders as follows
there are two ways to manage blob lifecycle through portal and through code. following method illustrates creating rules through portal