简体   繁体   中英

Azure Blob Storage Lifecycle Management - embedded folders

I'm currently trying to implement lifecycle management on a container where i have embeded folders as follows:

container1/1/test/done_filename.txt
container1/1/processed/complete_filename.txt
container1/1/wip_filename.txt

i tried creating a rule filter to delete files under the test folder that start with done however i waited 48 hours and it's still not removed.

Rule filter:
delete after 1 day 
Prefix Match:
file with this prefix: container1/1/test/done_

All samples I see from microsoft and online only mention "myContainer/prefix", am i to understand that the lifecycle management feature doesn't support subfolders/full paths? do all files have to be within the the root of the container? or what am i doing wrong here.

Updated showing rule definition:

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

I expect the above to delete any file under "container1/1/test/" that starts with "done_" but the file is still there when i check after a few days even though the file has not been modified.

If you have enabled the rule, then your policy and prefix match are ok.

You need to check some settings which can block the blob delete operation :

1.Make sure you can manually delete these blobs. You can try to delete one of them manually. Why we need to do that? If you have leased these blobs or set immutability policies , the delete operation are not allowed.

2.Check the settings in Networking pane of your storage account. And make sure you select the option "Allow access from All networks":

在此处输入图像描述

I was able to find the solution here: https://docs.microsoft.com/answers/answers/154361/view.html

When you are using selected networks because of security restrictions like we do then correct solution is to enable “Allow trusted Microsoft services to access this storage account” under Networking.

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