
If you’ve ever used Azure Table Storage you’ve probably wondered – where is the backup option?!! I mean, you can back up SQL server or NoSQL databases, and you can back up storage blobs and Azure files, so why not table storage? Microsoft do not provide any native backup solution for Azure table storage, therefore you either have to choose an alternative data store if you want to protect your data, or simply use table storage and accept the risk.
While building a solution recently that needed to use table storage, I investigated options for backup and came across a rather handy .Net library created by medienstudio, which nicely takes care of converting table storage data into CSV format, so I of course built a backup solution around that. Then it occurred to me this would be pretty useful outside of that solution too, for other Azure storage tables, so I decided to create a standalone solution that can backup any storage tables you want across multiple resource groups and storage accounts within an Azure subscription.
It works very nicely so I thought I would publish a ‘community’ version to help out others looking for automated table backups.
I’ve documented everything over on my docs.smsagent.blog site, so head over there for the how-to part.
Basically the solution uses an Azure function app with a timer trigger to run table backups on a schedule, and you can modify this schedule as you need, as well as run on-demand backups. The data is backed up to a storage container within the same storage account as the source tables, and you can back up as many tables as you like.
Restores can be easily done using the Microsoft Azure Storage Explorer which provides a nice UI for importing CSV files into a storage table.
I provide a PowerShell script that will create and configure the Azure resources for you, so the setup is super simple.
You use an Azure table to define which tables you want to backup in which storage accounts…

…and you can use lifecycle management rules on the storage containers to define how long you want to retain backups for.
Hope it is useful 🙂

