https://support.microsoft.com/en-us/help/4470999/db-backup-problems-to-sql-server-connector-for-azure-1-0-5-0

A breaking change has been introduced in Version 1.0.5.0 of 'SQL Server Connector for Microsoft Azure Key Vault' .  The 1.0.5.0 version updated the way it calculates thumbprints to match the logic used in the engine, in order to support the migration scenario of On Prem SQL Server using EKM to Azure SQL DB using TDE BYOK.  Because of this change, customer may hit issues when they are trying to restore database backups from when they were using 1.0.4.0 or old version to a server using 1.0.5.0 version.

Here is an example

===

SQL Server instance sql1 has 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.4.0 deployed. SQL Server instance sql2 has 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.5.0 deployed. Both instance sql1 and sql2 deploy an ASYMMETRIC key from the same ASYMMETRIC key in Azure Key Vault.

CREATE ASYMMETRIC KEY TDE_KEY

FROM PROVIDER AzureKeyVaultProvider

WITH PROVIDER_KEY_NAME = 'key1',

CREATION_DISPOSITION = OPEN_EXISTING

The thumbprints are different. The length of thumbprint of 1.0.5.0 version is little bit greater than the thumbprint of 1.0.4.0 version.

Here is example of thumbprint of 1.0.4.0 version

0x2C5677D76F76D77F80

Here is example of thumbprint of 1.0.5.0 version. Please note, both asymmetric keys are created from same source.

0x373B314B78E8D59A0925494558FEF14B726216C5

This breaking change causes problem in backup/restore scenario.

For example, if you have a backup of a database encrypted by an asymmetric key  in Azure Key vault in instance sql1.

The instance sql2 has same asymmetric key created.

If you try to restore the backup to instance sql2, the restore fails with the error message below

Msg 33111, Level 16, State 4, Line 20

Cannot find server asymmetric key with thumbprint '0x2C5677D76F76D77F80'.

Here is the query to retrieve the thumbprint of each key.

select thumbprint,* from master.sys.asymmetric_keys

Here is the query to retrieve the thumbprint of each TDE database

select db_name(ddek.database_id) as DatabaseName,ak.name as[Asymmetric key Name], ak.thumbprint From sys.dm_database_encryption_keys ddek inner join master.sys.asymmetric_keys ak on ak.thumbprint=ddek.encryptor_thumbprint

Solution

===

Copy the 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.4.0 or related version to the instance sql2 box.

Run the query below in sql2 to change the CRYPTOGRAPHIC PROVIDER to 1.0.4.0 version.

ALTER CRYPTOGRAPHIC PROVIDER AzureKeyVaultProvider

FROM FILE =

'C:\Program Files\SQL Server Connector for Microsoft Azure Key Vault\1.0.4.0\Microsoft.AzureKeyVaultService.EKM.dll'

Create a new asymmetric key using the 1.0.4.0 provider.

CREATE ASYMMETRIC KEY TDE_KEY_1040

FROM PROVIDER AzureKeyVaultProvider

WITH PROVIDER_KEY_NAME = 'key1',

CREATION_DISPOSITION = OPEN_EXISTING

After that, you are able to restore the backup.

Run the query below in sql2 to revert  the CRYPTOGRAPHIC PROVIDER to 1.0.5.0 version.

ALTER CRYPTOGRAPHIC PROVIDER AzureKeyVaultProvider

FROM FILE =

'C:\Program Files\SQL Server Connector for Microsoft Azure Key Vault\1.0.5.0\Microsoft.AzureKeyVaultService.EKM.dll'

You can either use the same asymmetric key or change to a new version asymmetric key to use the new thumbprint.

alter DATABASE ENCRYPTION KEY

ENCRYPTION BY SERVER ASYMMETRIC KEY KeyName1050Version

The thumbprint of same asymmetric key is not same in 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.4.0 and 'SQL Server Connector for Microsoft Azure Key的更多相关文章

  1. SQL语句实现不存在即插入,存在则increase某字段的功能insert into … on duplicate key update

    前提条件:必须是唯一主键: CREATE UNIQUE INDEX idx_vote_object ON test_customers_vote (`vote_object`, `vote_objec ...

  2. yii2.0 报错Cookievalidationkey Must Be Configured With A Secret Key

    'components' => [ 'request' => [ // !!! insert a secret key in the following (if it is empty) ...

  3. OpenSSL和Python实现RSA Key公钥加密私钥解密

    基于非对称算法的RSA Key主要有两个用途,数字签名和验证(私钥签名,公钥验证),以及非对称加解密(公钥加密,私钥解密).本文提供一个基于OpenSSL和Python进行非对称加解密的例子. 1. ...

  4. Redis百亿级Key存储方案(转)

    1 需求背景 该应用场景为DMP缓存存储需求,DMP需要管理非常多的第三方id数据,其中包括各媒体cookie与自身cookie(以下统称supperid)的mapping关系,还包括了supperi ...

  5. 转载文章(Redis中对key的操作)

    转载地址:http://www.cnblogs.com/stephen-liu74/archive/2012/03/26/2356951.html 一.概述: 在该系列的前几篇博客中,主要讲述的是与R ...

  6. Duplicate entry 'javajavajav' for key 'username'

    org.apache.ibatis.exceptions.PersistenceException: ### Error updating database.  Cause: com.mysql.jd ...

  7. 关于MapReduce中自定义带比较key类、比较器类(二)——初学者从源码查看其原理

    Job类 /**   * Define the comparator that controls    * how the keys are sorted before they   * are pa ...

  8. android初级篇之apk签名key keystore格式转pk8+x509.pem

    转自:http://www.jianshu.com/p/3bd5c68cc44d 常用的android的签名工具有两个即jarsigner 和apksigner.这两种使用的key格式不一样,keys ...

  9. 深入理解ConcurrentMap.putIfAbsent(key,value) 用法

    转自:http://blog.csdn.net/exceptional_derek/article/details/40384659 先看一段代码: public class Locale { pri ...

随机推荐

  1. 可编辑DIV与移动端软键盘兼容性问题汇总

    此文复现的所有兼容性问题均为以下情况: 1. 腾讯X5内核 2. 全屏webview 问题如下: 1. IOS12 中软键盘弹出导致页面顶部截断,并且无法恢复. 解决方法:添加交互事件,调用本地方法, ...

  2. 动态 Web Server 技术发展历程

    动态 Web Server 技术发展历程 开始接触 Java Web 方面的技术,此篇文章是以介绍 Web server 相关技术的演变为主来作为了解 Java servlet 的技术背景,目的是更好 ...

  3. Winform-DataGridView

    Winform-DataGridView 1 常用属性 // 1.点击后的选中模式 this.dgv.SelectionMode = DataGridViewSelectionMode.FullRow ...

  4. linux 命令基础一。

    UNIX是什么 UNIX的定义: UNIX是一个计算机操作系统,一个用来协调.管理和控制计算机硬件和软件资源的控制程序. UNIX操作系统的特点:多用户和多任务多用户表示在同一时刻可以有多个用户同时使 ...

  5. 英语口语练习系列-C26-广告-人际关系-辨别物体-如果

    词汇-广告 advertisement noun [ C ] UK /ədˈvɜː.tɪs.mənt/ US /æd.vɝːˈtaɪz.mənt/ informal ad, uk also infor ...

  6. Leetcode 记录(101~200)

    Now, I want to just use English to explain the problem, it's about two month before the interview, s ...

  7. Drying [POJ3104] [二分答案]

    背景 每件衣服都有一定单位水分,在不适用烘干器的情况下,每件衣服每分钟自然流失1个单位水分,但如果使用了烘干机则每分钟流失K个单位水分,但是遗憾是只有1台烘干机,每台烘干机同时只能烘干1件衣服,请问要 ...

  8. Space Elevator [POJ2392] [DP][优化]

    题目大意 n件物品,第i件hi高,有ci件,最高的一件不能超过ai的高度.问最高能堆多高 输入: 第一行,一个n 接下来每一行,为hi,ai,ci 输出,最高堆多高 样例输入: 37 40 35 23 ...

  9. 网络吞吐量 [CQOI2015] [网络流]

    Description 路由是指通过计算机网络把信息从源地址传输到目的地址的活动,也是计算机网络设计中的重点和难点.网络中实现路由转发的硬件设备称为路由器.为了使数据包最快的到达目的地,路由器需要选择 ...

  10. 检测版本更新,iOS

    检测版本更新的方法. //检查新版本 更新 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, ), ^ ...