You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault.md
+41-28Lines changed: 41 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Install and configure the SQL Server Connector for Azure Key Vault.
4
4
author: Rupp29
5
5
ms.author: arupp
6
6
ms.reviewer: vanto, randolphwest
7
-
ms.date: 10/05/2022
7
+
ms.date: 01/26/2023
8
8
ms.service: sql
9
9
ms.subservice: security
10
10
ms.topic: conceptual
@@ -22,7 +22,7 @@ helpviewer_keywords:
22
22
23
23
In this article, you install and configure the [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] Connector for Azure Key Vault.
24
24
25
-
> [!NOTE]
25
+
> [!NOTE]
26
26
> Extensible Key Management is [not supported](../../../linux/sql-server-linux-editions-and-components-2019.md#Unsupported) for SQL Server on Linux.
27
27
28
28
## Prerequisites
@@ -351,7 +351,7 @@ Id : https://contosoekmkeyvault.vault.azure.net:443/
351
351
Download the SQL Server Connector from the [Microsoft Download Center](https://go.microsoft.com/fwlink/p/?LinkId=521700). The download should be done by the administrator of the [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] computer.
352
352
353
353
> [!NOTE]
354
-
>
354
+
>
355
355
> - SQL Server Connector versions 1.0.0.440 and older have been replaced and are no longer supported in production environments and using the instructions on the [SQL Server Connector Maintenance & Troubleshooting](../../../relational-databases/security/encryption/sql-server-connector-maintenance-troubleshooting.md) page under [Upgrade of SQL Server Connector](sql-server-connector-maintenance-troubleshooting.md#upgrade-of--connector).
356
356
> - Starting with version 1.0.3.0, the SQL Server Connector reports relevant error messages to the Windows event logs for troubleshooting.
357
357
> - Starting with version 1.0.4.0, there is support for private Azure clouds, including Azure China, Azure Germany, and Azure Government.
@@ -369,13 +369,15 @@ The SQL Server Connector installation also allows you to optionally download sam
369
369
370
370
To view error code explanations, configuration settings, or maintenance tasks for the SQL Server Connector, see:
371
371
372
-
-[A. Maintenance Instructions for the SQL Server Connector](../../../relational-databases/security/encryption/sql-server-connector-maintenance-troubleshooting.md#AppendixA)
372
+
-[A. Maintenance Instructions for the SQL Server Connector](../../../relational-databases/security/encryption/sql-server-connector-maintenance-troubleshooting.md#AppendixA)
373
373
-[C. Error Code Explanations for the SQL Server Connector](../../../relational-databases/security/encryption/sql-server-connector-maintenance-troubleshooting.md#AppendixC)
374
374
375
375
## Step 4: Configure SQL Server
376
376
377
377
For a note about the minimum permission levels needed for each action in this section, see [B. Frequently Asked Questions](../../../relational-databases/security/encryption/sql-server-connector-maintenance-troubleshooting.md#AppendixB).
378
378
379
+
### Configure the `master` database
380
+
379
381
1. Run **sqlcmd** or open [!INCLUDE [ssmanstudiofull-md](../../../includes/ssmanstudiofull-md.md)].
380
382
381
383
1. Configure [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] to use EKM by running the following [!INCLUDE[tsql](../../../includes/tsql-md.md)] script:
@@ -457,7 +459,7 @@ For a note about the minimum permission levels needed for each action in this se
457
459
> [!IMPORTANT]
458
460
> Be sure to first complete the Registry prerequisites for this step.
459
461
460
-
- Replace `EKMSampleASYKey` with the name you'd like the key to have in [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)].
462
+
- Replace `EKMSampleASYKey` with the name you'd like the key to have in [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)].
461
463
- Replace `ContosoRSAKey0` with the name of your key in your Azure key vault.
462
464
463
465
```sql
@@ -476,8 +478,8 @@ For a note about the minimum permission levels needed for each action in this se
476
478
CREATION_DISPOSITION = OPEN_EXISTING;
477
479
```
478
480
479
-
In the preceding example script, `1a4d3b9b393c4678831ccc60def75379` represents the specific version of the key that will be used. If you use this script, it doesn't matter if you update the key with a new version. The key version (for example) `1a4d3b9b393c4678831ccc60def75379` will always be used for database operations.
480
-
481
+
In the preceding example script, `1a4d3b9b393c4678831ccc60def75379` represents the specific version of the key that will be used. If you use this script, it doesn't matter if you update the key with a new version. The key version (for example) `1a4d3b9b393c4678831ccc60def75379` will always be used for database operations.
482
+
481
483
For this scenario, you must complete two Registry prerequisites:
482
484
483
485
1. Create a `SQL Server Cryptographic Provider` registry key on`HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft`.
@@ -514,11 +516,13 @@ For a note about the minimum permission levels needed for each action in this se
514
516
ADD CREDENTIAL sysadmin_ekm_cred;
515
517
```
516
518
519
+
### Configure the user database to be encrypted
520
+
517
521
1. Create a test database that will be encrypted with the Azure key vault key.
518
522
519
523
```sql
520
524
--Create a test database that will be encrypted with the Azure key vault key
521
-
CREATE DATABASE TestTDE
525
+
CREATE DATABASE TestTDE;
522
526
```
523
527
524
528
1. Create a database encryption key by using the `ASYMMETRIC KEY` (`EKMSampleASYKey`).
@@ -543,37 +547,46 @@ For a note about the minimum permission levels needed for each action in this se
543
547
544
548
```sql
545
549
-- CLEAN UP
546
-
USE master
547
-
ALTER DATABASE [TestTDE] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
548
-
DROP DATABASE [TestTDE]
550
+
USE master;
551
+
GO
552
+
ALTER DATABASE [TestTDE] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
553
+
DROP DATABASE [TestTDE];
554
+
GO
549
555
550
-
ALTER LOGIN [TDE_Login] DROP CREDENTIAL [sysadmin_ekm_cred]
551
-
DROP LOGIN [TDE_Login]
556
+
ALTER LOGIN [TDE_Login] DROP CREDENTIAL [sysadmin_ekm_cred];
557
+
DROP LOGIN [TDE_Login];
558
+
GO
552
559
553
-
DROP CREDENTIAL [sysadmin_ekm_cred]
560
+
DROP CREDENTIAL [sysadmin_ekm_cred];
561
+
GO
554
562
555
-
USE master
556
-
DROP ASYMMETRIC KEY [EKMSampleASYKey]
557
-
DROP CRYPTOGRAPHIC PROVIDER [AzureKeyVault_EKM]
563
+
USE master;
564
+
GO
565
+
DROP ASYMMETRIC KEY [EKMSampleASYKey];
566
+
DROP CRYPTOGRAPHIC PROVIDER [AzureKeyVault_EKM];
567
+
GO
558
568
```
559
569
560
-
If the credential has a client secret that is about to expire, a new secret can be assigned to the credential.
570
+
For sample scripts, see the blog at [SQL Server Transparent Data Encryption and Extensible Key Management with Azure Key Vault](https://techcommunity.microsoft.com/t5/sql-server/intro-sql-server-transparent-data-encryption-and-extensible-key/ba-p/1427549).
561
571
562
-
-Update the secret originally created in [Step 1: Set up an Azure AD service principal](#step-1-set-up-an-azure-ad-service-principal).
572
+
## Client secrets that are about to expire
563
573
564
-
Alter the credential using the same identity andnew secret using the following code:
574
+
If the credential has a client secret that is about to expire, a new secret can be assigned to the credential.
565
575
566
-
```sql
567
-
ALTER CREDENTIAL CREDName
568
-
WITH IDENTITY = 'Original Identity',
569
-
SECRET = 'New Secret';
570
-
```
576
+
1. Update the secret originally created in [Step 1: Set up an Azure AD service principal](#step-1-set-up-an-azure-ad-service-principal).
571
577
572
-
- Restart the SQL Server service.
578
+
1. Alter the credential using the same identity and new secret using the following code. Replace `<New Secret>` with your new secret:
573
579
574
-
- Steps 2and3 need to be done on all nodes of an availability group.
580
+
```sql
581
+
ALTER CREDENTIAL sysadmin_ekm_cred
582
+
WITH IDENTITY = 'ContosoEKMKeyVault',
583
+
SECRET = '<New Secret>';
584
+
```
575
585
576
-
For sample scripts, see the blog at [SQL Server Transparent Data Encryption and Extensible Key Management with Azure Key Vault](https://techcommunity.microsoft.com/t5/sql-server/intro-sql-server-transparent-data-encryption-and-extensible-key/ba-p/1427549).
586
+
1. Restart the SQL Server service.
587
+
588
+
> [!NOTE]
589
+
> If you are using EKM in an availability group (AG), you will need to alter the credential and restart the SQL Server service on all nodes of the AG.
0 commit comments