Azure Table Storage Incremental backup to Azure Storage Blob

一笑奈何 提交于 2020-03-27 09:12:55

问题


Is there any way I can do Azure Table Storage backup in to Azure Blob incremental way. AZcopy has solution for full backup for the table but not incremental.

Is there any way I can recover Azure storage table, If I delete it from Azure storage explorer?


回答1:


As far as I know, currently azure doesn't support auto backup the table data into blob.

We need write codes to achieve this requirement.

I suggest you could use azure webjobs/function or azcopy(as you says) to achieve this.

If you want to achieve auto backup the data.

I suggest you could try to use timer trigger function to run codes which could backup the data every day or every minute.

More details about how to use timer trigger, you could refer to this article(azure function) or this(web jobs).




回答2:


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");
}


来源:https://stackoverflow.com/questions/46437051/azure-table-storage-incremental-backup-to-azure-storage-blob

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!