Azure Storage retention policy
Is there a way to implement a Azure table storage retention policy such that anything older than n number of days can be deleted from table storage? How would one go about implementing something like this?
February 12th, 2013 9:33pm

Currently this is not something available via platform. You would need to implement it yourself.

Regarding the implementation, it would be much easier and efficient if your PartitionKey somehow represented a date/time value. Do take a look at how Windows Azure Diagnostics data is configured. If you look closely at the PartitionKey value, it actually represents a date/time value (Ticks in UTC). If that's the case, then you could query the table for the date/time range using PartitionKey values and delete those records. For smaller tables, you could go with querying on "Timstamp" attribute but this would result in full table scan and thus not really suitable for very large tables.

Hope this helps.

Free Windows Admin Tool Kit Click here and download it now
February 13th, 2013 2:39am

Currently this is not something available via platform. You would need to implement it yourself.

Regarding the implementation, it would be much easier and efficient if your PartitionKey somehow represented a date/time value. Do take a look at how Windows Azure Diagnostics data is configured. If you look closely at the PartitionKey value, it actually represents a date/time value (Ticks in UTC). If that's the case, then you could query the table for the date/time range using PartitionKey values and delete those records. For smaller tables, you could go with querying on "Timstamp" attribute but this would result in full table scan and thus not really suitable for very large tables.

Hope this helps.

February 13th, 2013 2:39am

Hi janzero,

This is currently on our feature request list but we do not have a timeline to share.

To accomplish this, you could create a new table every N days and issue a delete table request for the previous one. This would be the most efficient approach.

Alternatively, consider batching deletes in an EntityGroupTransaction which can support up to 100 delete commands. However, this would require these entities to have same partitionKey.

Thanks,

Jean

Free Windows Admin Tool Kit Click here and download it now
February 13th, 2013 6:40am

Hi janzero,

This is currently on our feature request list but we do not have a timeline to share.

To accomplish this, you could create a new table every N days and issue a delete table request for the previous one. This would be the most efficient approach.

Alternatively, consider batching deletes in an EntityGroupTransaction which can support up to 100 delete commands. However, this would require these entities to have same partitionKey.

Thanks,

Jean

February 13th, 2013 6:40am

you need to have a kind of scheduled task in a worker which checks for stale data and remove it.
Free Windows Admin Tool Kit Click here and download it now
February 13th, 2013 9:15am

Please check this article

https://msdn.microsoft.com/en-us/library/azure/hh343263.aspx 

Hope this helps.

April 15th, 2015 4:04am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics