How Do I Backup Azure Tables and Blobs How Do I Backup Azure Tables and Blobs azure azure

How Do I Backup Azure Tables and Blobs


After doing a lot of research on the best way to automatically backup data, I found that the easiest way to do this is to schedule a job in the Windows Task Scheduler on an Azure virtual machine that uses AZCopy. AZCopy does the work of moving the table data to the VM and then back out to a secondary blob store in Azure to hold the backup. The batch file also causes AZCopy to copy the blobs from the source storage account into the target account directly.

You can see a detailed description of how I made this work complete with links to the batch files that I use to automate the backup at this link:http://www.eastfive.com/2016/03/01/automated-backup-of-azure-storage-tables-and-blobs/

02/08/2018 update on this answer:I raised this question to Azure support on January 18, 2018, assuming that surely they had a way to do this now via a service in Azure. Unfortunately that is not the case and there is (according to Microsoft support) no better way to do table backups than those that existed when this question was first posed. This is the answer from support from 01/24/2018:

"I have reviewed over your case and unfortunately there is not a way to do a snapshot of an entire account or container and so the only way to do snapshots with Azure Storage is through blob iteration and applying snapshots then migrating the snaps over to a secondary account. Or you can simply copy the actual files to another account but this would have higher latency and be more costly on storage capacity, where snapshots would take up less and be quicker to transfer.
The methods we support for transfer are AzCopy and the Data Movement Library which can be used to make custom migration solutions in Java or C#.
If you wanted to automate these processes then you could do this via Powershell and Azure Automation or with Azure Functions but assistance with those solutions would likely need to be raised through another support request as my team purely supports Azure Storage."

So, there still exists no automated way to do these backups. My team is working on a library to do backups. When we have that completed, I will post back here.

05/08/2018 update on this answer:As mentioned, my team has been working on a library to automate backups. You can find the project here: https://github.com/eastfivellc/EastFive.Azure.Storage.Backup. Please feel free to contribute.

10/18/2018 update on this answer:I was able to copy data in Azure using their Azure Data Factory functionality. I used Data Factory to pipe data from my source to target storage for both tables and blobs. However, the data movement costs are exorbitantly high (in the hundreds of dollars per backup). So, this is not a solution for backups. As mentioned in my post from above (and in an answer below), the Azure Data Movement Library is the best solution here.


We wrote a .NET library that backups tables and blobs. You can easily implement this in an azure function timer trigger.

In this blog I explain how to implement it using an Azure function.

[FunctionName("Function1")]public static async Task Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log, ExecutionContext context){  var sourceAccountName = Environment.GetEnvironmentVariable("BackupSourceAccountName");  var sourceKey = Environment.GetEnvironmentVariable("BackupSourceAccountKey");  var backupAzureStorage = new Luminis.AzureStorageBackup.BackupAzureStorage(sourceAccountName, sourceKey, log, context.FunctionAppDirectory);  var destinationAccountName = Environment.GetEnvironmentVariable("BackupDestinationAccountName");  var destinationKey = Environment.GetEnvironmentVariable("BackupDestinationAccountKey");  var destinationContainerName = Environment.GetEnvironmentVariable("BackupDestinationContainer");  // Backup Tables  await backupAzureStorage.BackupAzureTablesToBlobStorage("table1,table2", destinationAccountName, destinationKey, destinationContainerName, "tables");  // Backup Blobs  await backupAzureStorage.BackupBlobStorage("container1,container2", destinationAccountName, destinationKey, destinationContainerName, "blobs");}


You can also use 3rd party tools like Cerebrata Azure Management Cmdlets or the functionality Asynchronous Copy Blob announced by Microsoft Azure Storage team which will essentially allow you to copy data from one storage account to another storage account without downloading the data locally.

Check the thread for more: What is the best way to backup Azure Blob Storage contents.

Hope this helps.