如果我要在我的Azure DB中删除此证书会发生什么
我的主要目标是获得两个Azure数据库之间的跨数据库查询。为此,我遇到了弹性查询。我看到的有关如何开始使用弹性查询的示例显示,人们会通过密码加密创建主密钥:
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<password>';
GO
CREATE DATABASE SCOPED CREDENTIAL ElasticDBCredential WITH IDENTITY = 'ElasticUser', SECRET = '<password>';
GO
尽管我的数据库已经有了主密钥,并且当我尝试丢弃主密钥时,我会收到此消息
无法删除主密钥,因为凭据 'https:// hextps.windows.net/sqldbauditlogs'is 由它加密。
我已经打开了此DB的审核日志,显然是由现有的主密钥对其进行了加密的。我尝试丢弃这样做的凭据:
DROP DATABASE SCOPED CREDENTIAL [https://****.windows.net/sqldbauditlogs]
但这也返回错误:
无法删除凭据'https://xhydeby.windows.net/sqldbauditlogs',因为它正在使用。
我将如何制作它,以便它“不使用”,以便我可以使用它或可以使用现有的主密钥,我只是不知道该如何弄清楚当前是什么...
My main goal is to get Cross-Database queries working between two Azure Databases. In order to do so, I've come across Elastic Queries. The examples I've seen on how to get started with Elastic Queries show people creating a Master Key with encryption by password like so:
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<password>';
GO
CREATE DATABASE SCOPED CREDENTIAL ElasticDBCredential WITH IDENTITY = 'ElasticUser', SECRET = '<password>';
GO
Although my Database already has a Master Key, and I get this message when I try and drop the Master Key
Cannot drop master key because CREDENTIAL
'https://****.windows.net/sqldbauditlogs' is
encrypted by it.
I have Audit Logs turned on for this DB and it is encrypted by the existing Master Key, apparently. I tried dropping the Credential doing this:
DROP DATABASE SCOPED CREDENTIAL [https://****.windows.net/sqldbauditlogs]
But this also returns the error:
Cannot drop the credential 'https://****.windows.net/sqldbauditlogs' because it is being used.
How would I make it so it's "not in use" so that I can drop it OR I could use the existing Master Key, I just don't know how to figure out what it is currently...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要首先更改主密钥并使用新密码进行重新生成,如下所示:
任何使用旧主密钥的凭据都会自动继承新的主密钥,因为只能有一个主密钥。
现在,删除数据库加密密钥,然后删除证书,最后丢弃主密钥。
以下示例删除了数据库加密并删除数据库加密密钥。
放弃凭据。
You need to first ALTER the master key and regenerate it using the new password as follow:
Any CREDENTIAL using old master key will automatically inherit the new master key since there can only be one master key.
Now, drop the DATABASE ENCRYPTION KEY and then drop the CERTIFICATE and last drop the MASTER KEY.
The following example removes the database encryption and drops the database encryption key.
Drop the credentials.