本文介绍了你可以从远程C#应用程序创建一个SQL Azure的BACPAC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个工具,让备份和各个地方和放大器之间的SQL Azure数据库的恢复;蔚蓝的环境。

I'm working on a tool to allow backup and restore of SQL Azure databases between various local & azure environments.

我所在的BACPAC创建并直接传输到我的本地开发机器工作版本。

I have a working version where the BACPAC is created and directly streamed to my Local Developer machine.

不过,我一直没能找到一种方法来创建BACPAC和使用远程客户端Blob存储直接存储。任何我见过的例子无论是

But I haven't been able to find a way to create the bacpac and store it directly in Blob Storage using a remote client. Any of the examples I've seen either


  • 流备份到本地PC,然后将其重新上传到Blob存储


  • 依靠具有辅助角色部署在Azure的处理过程

有触发备份功能,就是可以通过Azure管理门户(创建备份(BACPAC方式)直接向Blob存储)从远程客户端?

Is there a way to trigger the Backup Functionality that's available through the Azure Management Portal (Create Backup (BACPAC) directly to Blob Storage) from a remote client?

推荐答案

您应该使用SQL Azure数据库进出口服务。
你可以找到更多关于这里这项服务

You should use SQL Azure Database Import Export Service.You can find more about this service here.

有关出口functionallity然后你可以使用这段代码:

For export functionallity you can then use this piece of code:

//Set Inputs to the REST Requests in the helper class
IEHelper.EndPointUri = @"<address of database endpoint according to its location, e.g. https://by1prod-dacsvc.azure.com/DACWebService.svc for DB located in West US>";
IEHelper.ServerName = "<database_server_name>.database.windows.net";
IEHelper.StorageKey = "<storage_key>";
IEHelper.DatabaseName = "<database_name>";
IEHelper.UserName = "<database_user_name>";
IEHelper.Password = "<database_password>";

//Do Export operation
string exportBlobPath = IEHelper.DoExport(String.Format(@"https://<storage_name>.blob.core.windows.net/bacpac/{0}.bacpac", IEHelper.DatabaseName));
ImportExportHelper IEHelper = new ImportExportHelper();

这篇关于你可以从远程C#应用程序创建一个SQL Azure的BACPAC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!