Visual Studio 2017异常 - 必须在数据库作用域凭据之前创建主密钥 [英] Visual Studio 2017 exception - Master Key must be created before a database scoped credential

查看:166
本文介绍了Visual Studio 2017异常 - 必须在数据库作用域凭据之前创建主密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人使用VS2017 SQL数据库项目可能对我在SQL工具论坛上添加的帖子有一些见解/建议 - 这里:


VS2017 - 必须在数据库作用域凭证之前创建
主密钥


我不确定它是否与Azure SQL DB隔离(没有尝试过其他方式)。 


我能够得到"周围"通过粘贴创建DATABASE SCOPED CREDENTIAL的项目中脚本顶部的CREATE MASTER KEY部分来解决此异常,然后只删除其他主密钥脚本。 这看起来像是一个黑客,但是
看起来像这样:

通过PASSWORD创建主键加密= 'MyPasswordHere'; 
GO

CREATE DATABASE SCOPED CREDENTIAL [SQL_Credential]
WITH IDENTITY = N'boss',SECRET = N'MyPasswordHere';




Bill Blakey

解决方案

Hello,





在将更改部署到更新时,主密钥不仅是一个问题数据库以及当您要导出Azure SQL
数据库和la时ter在SQL Server实例上导入它。







希望这会有所帮助。







问候,



Alberto Morillo

SQLCoffee.com


I'm hoping somebody that uses VS2017 SQL Database Projects might have some insight/suggestions for a post I added to on the SQL Tools Forum - here:

VS2017 - Master Key must be created before a database scoped credential

I'm unsure if this is isolated to Azure SQL DB or not (have not tried otherwise). 

I was able to get "around" this exception by pasting the CREATE MASTER KEY piece at the top of the script in the project which creates the DATABASE SCOPED CREDENTIAL, then just remove the other Master Key script.  This seems like a hack, but it looks like this:

CREATE MASTER KEY ENCRYPTION BY PASSWORD= 'MyPasswordHere';
GO

CREATE DATABASE SCOPED CREDENTIAL [SQL_Credential]
WITH IDENTITY = N'boss', SECRET = N'MyPasswordHere';


Bill Blakey

解决方案

Hello,

Master keys are not only an issue when deploying changes to the database but also when you want to export your Azure SQL Database and later import it on a SQL Server instance.



Hope this helps.



Regards,

Alberto Morillo
SQLCoffee.com


这篇关于Visual Studio 2017异常 - 必须在数据库作用域凭据之前创建主密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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