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: articles/event-hubs/configure-customer-managed-key.md
+89-34Lines changed: 89 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Configure your own key for encrypting Azure Event Hubs data at rest
3
3
description: This article provides information on how to configure your own key for encrypting Azure Event Hubs data rest.
4
4
ms.topic: conceptual
5
-
ms.date: 08/18/2021
5
+
ms.date: 05/13/2024
6
6
---
7
7
8
8
# Configure customer-managed keys for encrypting Azure Event Hubs data at rest
@@ -12,7 +12,7 @@ Azure Event Hubs provides encryption of data at rest with Azure Storage Service
12
12
> - The BYOK capability is supported by **premium** and **dedicated** tiers of Event Hubs.
13
13
> - The encryption can be enabled only for new or empty namespaces. If the namespace contains event hubs, the encryption operation will fail.
14
14
15
-
You can use Azure Key Vault to manage your keys and audit your key usage. You can either create your own keys and store them in a key vault, or you can use the Azure Key Vault APIs to generate keys. For more information about Azure Key Vault, see [What is Azure Key Vault?](../key-vault/general/overview.md)
15
+
You can use Azure Key Vault (including Azure Key Vault Managed HSM) to manage your keys and audit your key usage. You can either create your own keys and store them in a key vault, or you can use the Azure Key Vault APIs to generate keys. For more information about Azure Key Vault, see [What is Azure Key Vault?](../key-vault/general/overview.md)
16
16
17
17
This article shows how to configure a key vault with customer-managed keys by using the Azure portal. To learn how to create a key vault using the Azure portal, see [Quickstart: Create an Azure Key Vault using the Azure portal](../key-vault/general/quick-create-portal.md).
18
18
@@ -25,13 +25,19 @@ To enable customer-managed keys in the Azure portal, follow these steps. If you
> Currently you can't configure Azure Key Vault Managed HSM through the portal.
30
+
28
31
## Set up a key vault with keys
29
32
After you enable customer-managed keys, you need to associate the customer managed key with your Azure Event Hubs namespace. Event Hubs supports only Azure Key Vault. If you enable the **Encryption with customer-managed key** option in the previous section, you need to have the key imported into Azure Key Vault. Also, the keys must have **Soft Delete** and **Do Not Purge** configured for the key. These settings can be configured using [PowerShell](../key-vault/general/key-vault-recovery.md) or [CLI](../key-vault/general/key-vault-recovery.md).
30
33
31
34
1. To create a new key vault, follow the Azure Key Vault [Quickstart](../key-vault/general/overview.md). For more information about importing existing keys, see [About keys, secrets, and certificates](../key-vault/general/about-keys-secrets-certificates.md).
32
35
33
36
> [!IMPORTANT]
34
37
> Using customer-managed keys with Azure Event Hubs requires that the key vault have two required properties configured. They are: **Soft Delete** and **Do Not Purge**. These properties are enabled by default when you create a new key vault in the Azure portal. However, if you need to enable these properties on an existing key vault, you must use either PowerShell or Azure CLI.
38
+
39
+
# [Key Vault](#tab/Key-Vault)
40
+
35
41
1. To turn on both soft delete and purge protection when creating a vault, use the [az keyvault create](/cli/azure/keyvault#az-keyvault-create) command.
36
42
37
43
```azurecli-interactive
@@ -42,6 +48,22 @@ After you enable customer-managed keys, you need to associate the customer manag
42
48
```azurecli-interactive
43
49
az keyvault update --name ContosoVault --resource-group ContosoRG --enable-purge-protection true
1. To turn on both soft delete and purge protection when creating a vault, use the [az keyvault create](/cli/azure/keyvault#az-keyvault-create) command.
1. To add purge protection to an existing vault (that already has soft delete enabled), use the [az keyvault update](/cli/azure/keyvault#az-keyvault-update) command.
60
+
61
+
```azurecli-interactive
62
+
az keyvault update --hsm-name ContosoVault --resource-group ContosoRG --enable-purge-protection true
63
+
```
64
+
65
+
---
66
+
45
67
1. Create keys by following these steps:
46
68
1. To create a new key, select **Generate/Import** from the **Keys** menu under **Settings**.
47
69
@@ -182,20 +204,7 @@ This section shows you how to create an Azure Event Hubs namespace with managed
182
204
183
205
### Grant Event Hubs namespace identity access to key vault
184
206
185
-
1. Run the following command to create a key vault with **purge protection** and **soft-delete** enabled.
2. Set the key vault access policy so that the managed identity of the Event Hubs namespace can access key value in the key vault. Use the ID of the Event Hubs namespace from the previous section.
207
+
1. Set the key vault access policy so that the managed identity of the Event Hubs namespace can access key value in the key vault. Use the ID of the Event Hubs namespace from the previous section.
3. Run the following PowerShell command to deploy the Resource Manager template. Replace `{MyRG}` with the name of your resource group before running the command.
320
357
321
358
```powershell
@@ -334,27 +371,14 @@ Follow instructions from the [Create a user-assigned managed identity](../active
334
371
> [!NOTE]
335
372
> You can assign up to **4** user identities to a namespace. These associations are deleted when the namespace is deleted or when you pass the `identity -> type` in the template to `None`.
336
373
337
-
### Create a key vault and grant access to user-assigned identity
338
-
339
-
1. Run the following command to create a key vault with purge protection and soft-delete enabled.
2. Get the **Service principal ID** for the user identity using the following PowerShell command. In the example, `ud1` is the user-assigned identity to be used for encryption.
376
+
1. Get the **Service principal ID** for the user identity using the following PowerShell command. In the example, `ud1` is the user-assigned identity to be used for encryption.
0 commit comments