Azure SQL 服务器 BACPAC 导入失败

Azure SQL Server BACPAC import failed

每当我尝试在本地 sql 服务器上导入 BACPAC 时,我都会收到以下错误消息:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Could not import package.
Warning SQL0: The source contains users that rely on an external authentication provider that is not supported by the target. These users will be treated as users without logins.
Warning SQL72012: The object [DB_NAME_Data] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database but that are not in the source' check box.
Warning SQL72012: The object [DB_NAME_Log] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database but that are not in the source' check box.
Error SQL72014: .Net SqlClient Data Provider: Msg 33161, Level 15, State 1, Line 1 Database master keys without password are not supported in this version of SQL Server.
Error SQL72045: Script execution error.  The executed script:
CREATE MASTER KEY;


 (Microsoft.SqlServer.Dac)

------------------------------
BUTTONS:

OK
------------------------------

以前在 SO 上报告的所有问题都与这个问题不同。有没有人遇到过同样的问题?

最终我按照建议的选项 2 解决了这个问题 here

简而言之,

  1. here
  2. 中保存实用程序 RemoveMasterKeyFrombacpac
  3. 运行命令.\RemoveMasterKey.ps1 -bacpacPath "C:\BacPacs\fileName.bacpac"

一旦上述命令完成,我们就会得到无缝导入的补丁 bacpac。

更新

使用新的 MS SQL Server 2016 (13.0.1745.2) 和 SSMS v17.6 这不再是问题。

尝试 运行 针对您的 master 数据库(右键单击 SSMS 中的服务器名称 -> 新查询)

sp_configure 'contained database authentication', 1;
GO 
RECONFIGURE;
GO

在此之后,您可以再次执行导入 bacpac 向导,问题应该会得到解决。