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: azure-sql/virtual-machines/windows/managed-identity-extensible-key-management.md
+22-16Lines changed: 22 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@ title: Managed Identity Support for Extensible Key Management (EKM) with Azure K
3
3
description: Learn how to use managed identities with SQL Server on Azure Virtual Machines and Transparent Data Encryption (TDE) Extensible Key Management with Azure Key Vault.
4
4
author: Pietervanhove
5
5
ms.author: pivanho
6
-
ms.reviewer: vanto, mathoma
7
-
ms.date: 02/16/2025
6
+
ms.reviewer: vanto, mathoma, randolphwest
7
+
ms.date: 10/06/2025
8
8
ms.service: azure-vm-sql-server
9
9
ms.subservice: security
10
10
ms.topic: how-to
@@ -19,7 +19,7 @@ This article shows you how to use managed identities for Extensible Key Manageme
19
19
20
20
Starting with SQL Server 2022 Cumulative Update 17 (CU17), managed identities are supported for EKM with AKV and Managed Hardware Security Modules (HSM) on SQL Server on Azure VMs. Managed identities are the recommended authentication method to allow different Azure services to authenticate the SQL Server on Azure VM resource without using passwords or secrets. For more information on managed identities, see [Managed identity types](/entra/identity/managed-identities-azure-resources/overview#managed-identity-types).
21
21
22
-
> [!NOTE]
22
+
> [!NOTE]
23
23
> Managed identities are only supported for SQL Server on Azure VMs and not for SQL Server on-premises.
24
24
>
25
25
> For information on setting up EKM with AKV for SQL Server on-premises, see [Set up SQL Server TDE Extensible Key Management by using Azure Key Vault](/sql/relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault).
@@ -29,6 +29,10 @@ Starting with SQL Server 2022 Cumulative Update 17 (CU17), managed identities ar
29
29
- A SQL Server on Azure VM with SQL Server 2022 CU17 or later [registered with the SQL IaaS Agent extension](sql-agent-extension-manually-register-single-vm.md).
30
30
- The SQL Server instance using a managed identity for EKM must be [configured with Microsoft Entra authentication](configure-azure-ad-authentication-for-sql-vm.md), whether or not it's the instance registered with the extension.
31
31
- An Azure Key Vault and key created in the key vault. For more information, see [Create a key vault](/sql/relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault?tabs=portal#step-2-create-a-key-vault).
32
+
33
+
> [!NOTE]
34
+
> Only Azure Key Vault and Azure Key Vault Managed HSM are supported. Azure Cloud HSM isn't supported.
35
+
32
36
- Managed identities are supported for EKM with AKV. The primary managed identity for the SQL Server on Azure VM needs:
33
37
- To be assigned with a user-assigned managed identity or system-assigned managed identity. For more information, see [Configure managed identities on Azure virtual machines (VMs)](/entra/identity/managed-identities-azure-resources/how-to-configure-managed-identities) and [Enable Microsoft Entra authentication](configure-azure-ad-authentication-for-sql-vm.md#enable-microsoft-entra-authentication).
34
38
- To have the `Key Vault Crypto Service Encryption User` role for the primary managed identity assigned to the key vault if you're using [Azure role-based access control](/sql/relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault?tabs=portal#azure-role-based-access-control) or the *Unwrap Key* and *Wrap Key* permissions if you're using [vault access policy](/sql/relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault?tabs=portal#vault-access-policy).
@@ -43,30 +47,32 @@ Before you can create a credential using a managed identity, you need to add a r
43
47
The following example shows how to create a credential for a managed identity to use with the AKV:
44
48
45
49
```sql
46
-
CREATE CREDENTIAL [<akv-name>.vault.azure.net]
50
+
CREATE CREDENTIAL [<akv-name>.vault.azure.net]
47
51
WITH IDENTITY ='Managed Identity'
48
-
FOR CRYPTOGRAPHIC PROVIDER AzureKeyVault_EKM_Prov
52
+
FOR CRYPTOGRAPHIC PROVIDER AzureKeyVault_EKM_Prov;
49
53
```
50
54
51
55
You can check the AKV name by querying `sys.credentials`:
52
56
53
57
```sql
54
58
SELECT name, credential_identity
55
-
FROMsys.credentials
59
+
FROMsys.credentials;
56
60
```
57
61
58
62
The `WITH IDENTITY = 'Managed Identity'` clause requires a primary managed identity assigned to the SQL Server on Azure VM.
59
63
60
64
For more information on setting up EKM with AKV, see [Set up SQL Server TDE Extensible Key Management by using Azure Key Vault](/sql/relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault).
61
65
62
-
## Creating a credential to use with Managed Hardware Security Modules (HSMs)
FOR CRYPTOGRAPHIC PROVIDER AzureKeyVault_EKM_Prov;
70
76
```
71
77
72
78
For more information on setting up EKM with AKV, see [Set up SQL Server TDE Extensible Key Management by using Azure Key Vault](/sql/relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault).
@@ -78,31 +84,31 @@ If your current configuration is using EKM with AKV using a secret, you'll need
78
84
1. Create the credential using a managed identity:
79
85
80
86
```sql
81
-
CREATE CREDENTIAL [<akv-name>.vault.azure.net]
87
+
CREATE CREDENTIAL [<akv-name>.vault.azure.net]
82
88
WITH IDENTITY ='Managed Identity'
83
-
FOR CRYPTOGRAPHIC PROVIDER AzureKeyVault_EKM_Prov
89
+
FOR CRYPTOGRAPHIC PROVIDER AzureKeyVault_EKM_Prov;
84
90
```
85
91
86
92
1. If there's a credential using a secret associated with the SQL Server administration domain login, drop the existing credential:
87
93
88
94
```sql
89
95
ALTER LOGIN [<domain>\<login>]
90
-
DROP CREDENTIAL [<existing-credential-name>]
96
+
DROP CREDENTIAL [<existing-credential-name>];
91
97
```
92
98
93
99
1. Associate the new credential with the SQL Server administration domain login:
94
100
95
101
```sql
96
102
ALTER LOGIN [<domain>\<login>]
97
-
ADD CREDENTIAL [<akv-name>.vault.azure.net]
103
+
ADD CREDENTIAL [<akv-name>.vault.azure.net];
98
104
```
99
105
100
106
You can check the encrypted database view to verify the database encryption using the following query:
101
107
102
108
```sql
103
-
SELECT*
104
-
FROMsys.dm_database_encryption_keys
105
-
WHERE database_id=db_id('<your-database-name>')
109
+
SELECT*
110
+
FROMsys.dm_database_encryption_keys
111
+
WHERE database_id=db_id('<your-database-name>');
106
112
```
107
113
108
114
For more information on setting up EKM with AKV, see [Set up SQL Server TDE Extensible Key Management by using Azure Key Vault](/sql/relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault).
The [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] Connector for [!INCLUDE[msCoName](../../../includes/msconame-md.md)] Azure Key Vault enables [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] encryption to use the Azure Key Vault service as an [Extensible Key Management (EKM)](../../../relational-databases/security/encryption/extensible-key-management-ekm.md) provider to protect [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] encryption keys.
24
-
25
-
This topic describes the [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] connector. Additional information is available in [Setup Steps for Extensible Key Management Using the Azure Key Vault](../../../relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault.md), [Use SQL Server Connector with SQL Encryption Features](../../../relational-databases/security/encryption/use-sql-server-connector-with-sql-encryption-features.md), and [SQL Server Connector Maintenance & Troubleshooting](../../../relational-databases/security/encryption/sql-server-connector-maintenance-troubleshooting.md).
26
-
27
-
## <aname="Uses"></a> What is Extensible Key Management (EKM) and Why Use it?
28
-
[!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] provides several types of encryption that help protect sensitive data, including [Transparent Data Encryption (TDE)](../../../relational-databases/security/encryption/transparent-data-encryption.md), [Column Level Encryption](../../../relational-databases/security/encryption/encrypt-a-column-of-data.md) (CLE), and [Backup Encryption](../../../relational-databases/backup-restore/backup-encryption.md). In all of these cases, in this traditional key hierarchy, the data is encrypted using a symmetric data encryption key (DEK). The symmetric data encryption key is further protected by encrypting it with a hierarchy of keys stored in [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)]. Instead of this model, the alternative is the EKM Provider Model. Using the EKM provider architecture enables [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] to protect the data encryption keys by using an asymmetric key stored outside of [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] in an external cryptographic provider. This model adds an additional layer of security and separates the management of keys and data.
29
-
30
-
The following image compares the traditional service-manage key hierarchy with the Azure Key Vault system.
31
-
32
-

33
-
34
-
35
-
The [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] Connector serves as a bridge between [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] and Azure Key Vault, so [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] can leverage the scalability, high performance, and high availability of the Azure Key Vault service. The following image represents how the key hierarchy works in the EKM provider architecture with Azure Key Vault and [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] Connector.
36
-
37
-
Azure Key Vault can be used with [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] installations on [!INCLUDE[msCoName](../../../includes/msconame-md.md)] Azure Virtual Machines and for on-premises servers. The key vault service also provides the option to use tightly controlled and monitored Hardware Security Modules (HSMs) for a higher level of protection for asymmetric encryption keys. For more information about the key vault, see [Azure Key Vault](/azure/key-vault/general/basic-concepts).
38
-
39
-
The following image summarizes the process flow of EKM using the key vault. (The process step numbers in the image are not meant to match the setup step numbers that follow the image.)
40
-
41
-

25
+
The [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] Connector for Azure Key Vault enables [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] encryption to use the Azure Key Vault service as an [Extensible Key Management (EKM)](extensible-key-management-ekm.md) provider to protect [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] encryption keys.
26
+
27
+
This article describes the [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] connector. More information is available in:
28
+
29
+
-[Set up SQL Server TDE Extensible Key Management by using Azure Key Vault](setup-steps-for-extensible-key-management-using-the-azure-key-vault.md)
30
+
-[Use SQL Server Connector with SQL Encryption Features](use-sql-server-connector-with-sql-encryption-features.md)
31
+
-[SQL Server Connector Maintenance & Troubleshooting](sql-server-connector-maintenance-troubleshooting.md)
32
+
33
+
<aid="Uses"></a>
34
+
35
+
## What is Extensible Key Management (EKM) and why use it?
36
+
37
+
[!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] provides several types of encryption that help protect sensitive data, including [Transparent data encryption (TDE)](transparent-data-encryption.md), [Encrypt a Column of Data](encrypt-a-column-of-data.md) (CLE), and [Backup encryption](../../backup-restore/backup-encryption.md). In all of these cases, in this traditional key hierarchy, the data is encrypted using a symmetric data encryption key (DEK). The symmetric data encryption key is further protected by encrypting it with a hierarchy of keys stored in [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)].
38
+
39
+
Instead of this model, the alternative is the EKM Provider Model. Using the EKM provider architecture enables [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] to protect the data encryption keys by using an asymmetric key stored outside of [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] in an external cryptographic provider. This model adds an additional layer of security and separates the management of keys and data.
40
+
41
+
The following image compares the traditional service-manage key hierarchy with the Azure Key Vault system.
42
+
43
+
:::image type="content" source="media/ekm-key-hierarchy-traditional.png" alt-text="Diagram that compares the traditional service-manage key hierarchy with the Azure Key Vault system." lightbox="media/ekm-key-hierarchy-traditional.png":::
44
+
45
+
The [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] Connector serves as a bridge between [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] and Azure Key Vault, so [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] can use the scalability, high performance, and high availability of the Azure Key Vault service. The following image represents how the key hierarchy works in the EKM provider architecture with Azure Key Vault and [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] Connector.
46
+
47
+
Azure Key Vault can be used with [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] installations on Azure Virtual Machines and for on-premises servers. The key vault service also provides the option to use tightly controlled and monitored Hardware Security Modules (HSMs) for a higher level of protection for asymmetric encryption keys. For more information about the key vault, see [Azure Key Vault](/azure/key-vault/general/basic-concepts).
48
+
49
+
> [!NOTE]
50
+
> Only Azure Key Vault and Azure Key Vault Managed HSM are supported. Azure Cloud HSM isn't supported.
51
+
52
+
The following image summarizes the process flow of EKM using the key vault. (The process step numbers in the image aren't meant to match the setup step numbers that follow the image.)
53
+
54
+
:::image type="content" source="media/ekm-using-azure-key-vault.png" alt-text="Screenshot of SQL Server EKM using the Azure Key Vault." lightbox="media/ekm-using-azure-key-vault.png":::
42
55
43
56
> [!NOTE]
44
-
> Versions 1.0.0.440 and older have been replaced and are no longer supported in production environments. Upgrade to version 1.0.1.0 or later by visiting the [Microsoft Download Center](https://www.microsoft.com/download/details.aspx?id=45344) 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."
45
-
46
-
For the next step, see [Setup Steps for Extensible Key Management Using the Azure Key Vault](../../../relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault.md).
47
-
48
-
For use scenarios, see [Use SQL Server Connector with SQL Encryption Features](../../../relational-databases/security/encryption/use-sql-server-connector-with-sql-encryption-features.md).
49
-
50
-
## See Also
51
-
[SQL Server Connector Maintenance & Troubleshooting](../../../relational-databases/security/encryption/sql-server-connector-maintenance-troubleshooting.md)
52
-
57
+
> Versions 1.0.0.440 and older are no longer supported in production environments. Upgrade to version 1.0.1.0 or a later version by visiting the [Microsoft Download Center](https://www.microsoft.com/download/details.aspx?id=45344) and using the instructions on the [SQL Server Connector Maintenance & Troubleshooting](sql-server-connector-maintenance-troubleshooting.md) page under "Upgrade of SQL Server Connector."
58
+
59
+
For the next step, see [Set up SQL Server TDE Extensible Key Management by using Azure Key Vault](setup-steps-for-extensible-key-management-using-the-azure-key-vault.md).
60
+
61
+
For use scenarios, see [Use SQL Server Connector with SQL Encryption Features](use-sql-server-connector-with-sql-encryption-features.md).
62
+
63
+
## Related content
64
+
65
+
-[SQL Server Connector Maintenance & Troubleshooting](sql-server-connector-maintenance-troubleshooting.md)
0 commit comments