我试图用代码导出bacpac,但是我得到了一个错误,上面写着
Microsoft.SqlServer.Dac.DacServicesException:“数据库源不是Server tcp:xxxxxxx.database.windows.net,1433: test.com的受支持版本。”
我可以用SSMS (导出数据层应用程序)导出它,没有任何问题。
我的测试程序是C# .NET 4,已经导入了Microsoft.SqlServer.Dac-x86 nuget。
Samplecode:
var azureServices = new DacServices($"Data Source={source},1433;Initial Catalog=test;Integrated Security=False;User ID={user};Password={password}");
azureServices.Message += AzureServices_Message;
azureServices.ProgressChanged += AzureServices_ProgressChanged;
azureServices.ExportBacpac(Environment.CurrentDirectory + "test" + DateTime.Now.ToShortTimeString(), "test");我做错了什么?还是微软在Azure sql中破坏了什么东西?
编辑:我需要在本地下载bacpac,这就是为什么我不使用rest导出到blob存储。
发布于 2018-04-11 11:11:47
请考虑使用REST来代替:
抽样请求:
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/testdb/export?api-version=2014-04-01请求机构:
{
"storageKeyType": "StorageAccessKey",
"storageKey": "sdlfkjdsf+sdlfkjsdlkfsjdfLDKFJSDLKFDFKLjsdfksjdflsdkfD2342309432849328479324/3RSD==",
"storageUri": "https://test.blob.core.windows.net/bacpacs/testbacpac.bacpac",
"administratorLogin": "dummyLogin",
"administratorLoginPassword": "Un53cuRE!",
"authenticationType": "SQL"
}有关更多信息,请阅读这文档。
https://stackoverflow.com/questions/49771935
复制相似问题