Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
358 views
in Technique[技术] by (71.8m points)

Is it possible to read actual applied immutable policy on a blob - remaining Time-based retention in days

I have applied a Time-based retention e.g. 5 days. Is it possible to read on each blob / their metadata, when this policy is expiring...

Same way as we can read on soft deleted blobs RemainingRetentionDays??

question from:https://stackoverflow.com/questions/65885891/is-it-possible-to-read-actual-applied-immutable-policy-on-a-blob-remaining-tim

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For Time-based immutable policy, there is no direct way to know when this policy is expiring. You need to calculate it by yourself. For example, if the Time-based retention is 5-days, then you upload a blob in January 1. Then in January 2, it has 4-days to be expired.

For soft deleted blobs, yes, you can read the RemainingRetentionDays by using code or using UI.

Here is an example to read this value via UI, you should install Azure Storage Explorer. Then you can see the RemainingRetentionDays for each deleted blobs(Note: due to this bug, you should turn off versioning feature.):

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...