Set lifecycle rules based on last accessed in Azure storage

166 Views Asked by At

Is it possible to natively set a life cycle policy to delete files not accessed since X-days? If not, is there a possible to use the blob API for that?

PS: I don't mind whether to use v2 data lake or regular blob storage

1

There are 1 best solutions below

0
rickvdbosch On

Yes, this is possible.
Have a look at the daysAfterLastAccessTimeGreaterThan Action run condition. Please be advised that if last access time tracking is not enabled, daysAfterLastAccessTimeGreaterThan uses the date the lifecycle policy was enabled instead of the LastAccessTime property of the blob. This date is also used when the LastAccessTime property is a null value.

For more information, see Optimize costs by automatically managing the data lifecycle - Move data based on last accessed time.