如何备份Azure表和Blob [英] How Do I Backup Azure Tables and Blobs

查看:105
本文介绍了如何备份Azure表和Blob的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将数据存储在Azure存储表和Blob存储中.我想自动备份我的数据,以防止用户或软件问题造成的意外数据损坏. Microsoft对此没有一个好的解决方案,虽然有自动备份的付费解决方案,但似乎应该有一种直接的方法来备份和还原此数据.

I store data in Azure Storage tables and blob storage. I would like to automatically backup my data to protect against accidental data corruption by users or by a software issue. There isn't a good solution for this from Microsoft and, while there are paid solutions for automatic backups, it seems like there should be a straight-forward way to backup and restore this data.

推荐答案

在研究了自动备份数据的最佳方法之后,我发现最简单的方法是在Windows Task中安排作业使用AZCopy的Azure虚拟机上的计划程序. AZCopy进行的工作是将表数据移至VM,然后移回Azure中的辅助Blob存储以保存备份.批处理文件还会使AZCopy将blob从源存储帐户直接复制到目标帐户.

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.

您可以在以下链接上看到有关如何使这项工作完成的详细说明,该链接指向我用来自动执行备份的批处理文件的链接: http://www. eastfive.com/2016/03/01/automated-backup-of-azure-storage-tables-and-blobs/

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/

2018年2月8日此答案的更新: 我在2018年1月18日向Azure支持人员提出了这个问题,假设他们肯定可以通过Azure中的服务来执行此操作.不幸的是,情况并非如此,并且(根据Microsoft的支持)没有比第一次提出此问题时存在的表备份更好的方法.这是从2018年1月24日起获得支持的答案:

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:

我已经审查了您的案子,很遗憾,没有办法 制作整个帐户或容器的快照,所以唯一的方法 通过blob迭代和使用Azure存储来做快照, 应用快照,然后将快照迁移到辅助快照 帐户.或者您可以简单地将实际文件复制到另一个帐户 但这会带来更高的延迟,并且存储成本更高 容量,快照将更少且更快地被占用 转移.
我们支持传输的方法是AzCopy和 数据移动库,可用于进行自定义迁移 Java或C#中的解决方案.
如果您想自动化这些过程 那么您可以通过Powershell和Azure自动化或通过 Azure功能,但可能需要有关这些解决方案的帮助 完全是由我的团队通过另一个支持请求提出的 支持Azure存储."

"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.

2018年5月8日此答案的更新: 如前所述,我的团队一直在研究如何自动执行备份的库.您可以在这里找到项目: https://github.com/eastfivellc/EastFive.Azure.Storage.Backup .请随时贡献.

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.

2018年10月18日此答案的更新: 我能够使用其Azure数据工厂功能在Azure中复制数据.我使用Data Factory将数据从源管道传输到表和Blob的目标存储.但是,数据移动成本过高(每次备份花费数百美元).因此,这不是备份的解决方案.正如我在上面的帖子(以及下面的答案)中提到的那样,Azure数据移动库是此处的最佳解决方案.

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.

这篇关于如何备份Azure表和Blob的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆