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
# Configure customer-managed keys in an Azure key vault for an existing storage account
@@ -109,6 +109,8 @@ az role assignment create --assignee-object-id $principalId \
109
109
110
110
When you configure encryption with customer-managed keys for an existing storage account, you can choose to automatically update the key version used for Azure Storage encryption whenever a new version is available in the associated key vault. Alternately, you can explicitly specify a key version to be used for encryption until the key version is manually updated.
111
111
112
+
When the key version is changed, whether automatically or manually, the protection of the root encryption key changes, but the data in your Azure Storage account remains encrypted at all times. There is no additional action required on your part to ensure that your data is protected. Rotating the key version doesn't impact performance. There is no downtime associated with rotating the key version.
113
+
112
114
You can use either a system-assigned or user-assigned managed identity to authorize access to the key vault when you configure customer-managed keys for an existing storage account.
113
115
114
116
> [!NOTE]
@@ -269,10 +271,18 @@ When you manually update the key version, you'll need to update the storage acco
269
271
270
272
---
271
273
274
+
## The impact of changing customer-managed keys
275
+
276
+
When customer-managed keys are enabled or disabled, or the key or key version is changed, the protection of the root encryption key changes, but the data in your Azure Storage account remains encrypted at all times. There is no additional action required on your part to ensure that your data is protected. Rotating the key version doesn't impact performance. There is no downtime associated with rotating the key version.
If the new key is in a different key vault, you must [grant the managed identity access to the key in the new vault](#choose-a-managed-identity-to-authorize-access-to-the-key-vault). If you choose manual updating of the key version, you will also need to [update the key vault URI](#configure-encryption-for-manual-updating-of-key-versions).
Disabling the key will cause attempts to access data in the storage account to fail with error code 403 (Forbidden). For a list of storage account operations that will be affected by disabling the key, see [Revoke access to a storage account that uses customer-managed keys](customer-managed-keys-overview.md#revoke-access-to-a-storage-account-that-uses-customer-managed-keys).
If the new key is in a different key vault, you must [grant the managed identity access to the key in the new vault](#use-a-user-assigned-managed-identity-to-authorize-access-to-the-key-vault). If you choose manual updating of the key version, you will also need to [update the key vault URI](#configure-encryption-for-manual-updating-of-key-versions).
Disabling the key will cause attempts to access data in the storage account to fail with error code 403 (Forbidden). For a list of storage account operations that will be affected by disabling the key, see [Revoke access to a storage account that uses customer-managed keys](customer-managed-keys-overview.md#revoke-access-to-a-storage-account-that-uses-customer-managed-keys).
Copy file name to clipboardExpand all lines: articles/storage/common/customer-managed-keys-overview.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ services: storage
6
6
author: tamram
7
7
8
8
ms.service: storage
9
-
ms.date: 12/13/2022
9
+
ms.date: 03/09/2023
10
10
ms.topic: conceptual
11
11
ms.author: tamram
12
12
ms.reviewer: ozgun
@@ -62,7 +62,7 @@ Data in Blob storage and Azure Files is always protected by customer-managed key
62
62
63
63
## Enable customer-managed keys for a storage account
64
64
65
-
When you configure a customer-managed key, Azure Storage wraps the root data encryption key for the account with the customer-managed key in the associated key vault or managed HSM. Enabling customer-managed keys doesn't impact performance, and takes effect immediately.
65
+
When you configure a customer-managed key, Azure Storage wraps the root data encryption key for the account with the customer-managed key in the associated key vault or managed HSM. Enabling customer-managed keys takes effect immediately and doesn't impact performance.
66
66
67
67
You can configure customer-managed keys with the key vault and storage account in the same tenant or in different Azure AD tenants. To learn how to configure Azure Storage encryption with customer-managed keys when the key vault and storage account are in the same tenants, see one of the following articles:
68
68
@@ -74,7 +74,7 @@ To learn how to configure Azure Storage encryption with customer-managed keys wh
74
74
-[Configure cross-tenant customer-managed keys for a new storage account](customer-managed-keys-configure-cross-tenant-new-account.md)
75
75
-[Configure cross-tenant customer-managed keys for an existing storage account](customer-managed-keys-configure-cross-tenant-existing-account.md)
76
76
77
-
When you enable or disable customer-managed keys, or when you modify the key or the key version, the protection of the root encryption key changes, but the data in your Azure Storage account doesn't need to be re-encrypted.
77
+
When you enable or disable customer-managed keys, or when you modify the key or the key version, the protection of the root encryption key changes, but the data in your Azure Storage account remains encrypted at all times. There is no additional action required on your part to ensure that your data is protected. Rotating the key version doesn't impact performance. There is no downtime associated with rotating the key version.
78
78
79
79
You can enable customer-managed keys on both new and existing storage accounts. When you enable customer-managed keys, you must specify a managed identity to be used to authorize access to the key vault that contains the key. The managed identity may be either a user-assigned or system-assigned managed identity:
80
80
@@ -106,14 +106,14 @@ When you configure encryption with customer-managed keys, you have two options f
106
106
107
107
When the key version is explicitly specified, then you must manually update the storage account to use the new key version URI when a new version is created. To learn how to update the storage account to use a new version of the key, see [Configure encryption with customer-managed keys stored in Azure Key Vault](customer-managed-keys-configure-key-vault.md) or [Configure encryption with customer-managed keys stored in Azure Key Vault Managed HSM](customer-managed-keys-configure-key-vault-hsm.md).
108
108
109
-
When you update the key version, the protection of the root encryption key changes, but the data in your Azure Storage account isn't re-encrypted. There's no further action required from the user.
109
+
When you enable or disable customer-managed keys, or when you modify the key or the key version, the protection of the root encryption key changes, but the data in your Azure Storage account remains encrypted at all times. There is no additional action required on your part to ensure that your data is protected. Rotating the key version doesn't impact performance. There is no downtime associated with rotating the key version.
110
110
111
111
> [!NOTE]
112
-
> To rotate a key, create a new version of the key in the key vault or managed HSM, according to your compliance policies. You can rotate your key manually or create a function to rotate it on a schedule.
112
+
> To rotate a key, create a new version of the key in the key vault or managed HSM, according to your compliance policies. Azure Storage does not handle key rotation, so you will need to manage rotation of the key in the key vault. You can [rotate your keys manually](customer-managed-keys-configure-existing-account.md#configure-encryption-for-manual-updating-of-key-versions) or [configure them to rotate automatically](customer-managed-keys-configure-existing-account.md#configure-encryption-for-automatic-updating-of-key-versions).
113
113
114
-
## Revoke access to customer-managed keys
114
+
## Revoke access to a storage account that uses customer-managed keys
115
115
116
-
You can revoke the storage account's access to the customer-managed key at any time. After access to customer-managed keys is revoked, or after thekey has been disabled or deleted, clients can't call operations that read from or write to a blob or its metadata. Attempts to call any of the following operations will fail with error code 403 (Forbidden) for all users:
116
+
To revoke access to a storage account that uses customer-managed keys, disable the key that is currently being used. To learn how to disable a key in the Azure key vault, see [The impact of changing customer-managed keys](customer-managed-keys-configure-existing-account.md#the-impact-of-changing-customer-managed-keys). After the key has been disabled, clients can't call operations that read from or write to a blob or its metadata. Attempts to call any of the following operations will fail with error code 403 (Forbidden) for all users:
117
117
118
118
-[List Blobs](/rest/api/storageservices/list-blobs), when called with the `include=metadata` parameter on the request URI
Copy file name to clipboardExpand all lines: includes/storage-customer-managed-keys-disable-include.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,28 @@ services: storage
5
5
author: tamram
6
6
ms.service: storage
7
7
ms.topic: "include"
8
-
ms.date: 08/22/2022
8
+
ms.date: 03/10/2023
9
9
ms.author: tamram
10
10
ms.custom: "include file"
11
11
---
12
12
13
-
## Disable customer-managed keys
13
+
## Switch back to Microsoft-managed keys
14
14
15
-
When you disable customer-managed keys, your storage account is once again encrypted with Microsoft-managed keys.
15
+
You can switch from customer-managed keys back to Microsoft-managed keys at any time, using the Azure portal, PowerShell, or the Azure CLI.
16
16
17
17
# [Azure portal](#tab/azure-portal)
18
18
19
-
To disable customer-managed keys in the Azure portal, follow these steps:
19
+
To switch from customer-managed keys back to Microsoft-managed keys in the Azure portal, follow these steps:
20
20
21
-
1. Navigate to your storage account and display the **Encryption** settings.
22
-
1. Deselect the checkbox next to the **Use your own key** setting.
21
+
1. Navigate to your storage account.
22
+
1. Under **Security + networking**, select **Encryption**.
23
+
1. Change **Encryption type** to **Microsoft-managed keys**.
24
+
25
+
:::image type="content" source="../articles/storage/common/media/customer-managed-keys-configure-common/portal-enable-microsoft-managed-keys.png" alt-text="Screenshot showing how to switch to Microsoft-managed keys for a storage account.":::
23
26
24
27
# [PowerShell](#tab/azure-powershell)
25
28
26
-
To disable customer-managed keys with PowerShell, call [Set-AzStorageAccount](/powershell/module/az.storage/set-azstorageaccount) with the `-StorageEncryption` option, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
29
+
To switch from customer-managed keys back to Microsoft-managed keys with PowerShell, call [Set-AzStorageAccount](/powershell/module/az.storage/set-azstorageaccount) with the `-StorageEncryption` option, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
To disable customer-managed keys with Azure CLI, call [az storage account update](/cli/azure/storage/account#az-storage-account-update) and set the `--encryption-key-source parameter` to `Microsoft.Storage`, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
39
+
To switch from customer-managed keys back to Microsoft-managed keys with Azure CLI, call [az storage account update](/cli/azure/storage/account#az-storage-account-update) and set the `--encryption-key-source parameter` to `Microsoft.Storage`, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
Copy file name to clipboardExpand all lines: includes/storage-customer-managed-keys-revoke-include.md
+37-11Lines changed: 37 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,36 +5,62 @@ services: storage
5
5
author: tamram
6
6
ms.service: storage
7
7
ms.topic: "include"
8
-
ms.date: 08/22/2022
8
+
ms.date: 03/10/2023
9
9
ms.author: tamram
10
10
ms.custom: "include file"
11
11
---
12
12
13
-
## Revoke customer-managed keys
13
+
## Revoke access to a storage account that uses customer-managed keys
14
14
15
-
Revoking a customer-managed key removes the association between the storage account and the key vault.
15
+
To temporarily revoke access to a storage account that is using customer-managed keys, disable the key currently being used in the key vault.
16
16
17
17
# [Azure portal](#tab/azure-portal)
18
18
19
-
To revoke customer-managed keys with the Azure portal, disable the key as described in [Disable customer-managed keys](#disable-customer-managed-keys).
19
+
To disable a customer-managed key with the Azure portal, follow these steps:
20
+
21
+
1. Navigate to the key vault that contains the key.
22
+
1. Under **Objects**, select **Keys**.
23
+
1. Right-click the key and select **Disable**.
24
+
25
+
:::image type="content" source="../articles/storage/common/media/customer-managed-keys-configure-common/portal-disable-customer-managed-keys.png" alt-text="Screenshot showing how to disable a customer-managed key in the key vault.":::
20
26
21
27
# [PowerShell](#tab/azure-powershell)
22
28
23
-
You can revoke customer-managed keys by removing the key vault access policy. To revoke a customer-managed key with PowerShell, call the [Remove-AzKeyVaultAccessPolicy](/powershell/module/az.keyvault/remove-azkeyvaultaccesspolicy) command, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
29
+
To revoke a customer-managed key with PowerShell, call the [Update-AzKeyVaultKey](/powershell/module/az.keyvault/update-azkeyvaultkey) command, as shown in the following example. Remember to replace the placeholder values in brackets with your own values to define the variables, or use the variables defined in the previous examples.
You can revoke customer-managed keys by removing the key vault access policy. To revoke a customer-managed key with Azure CLI, call the [az keyvault delete-policy](/cli/azure/keyvault#az-keyvault-delete-policy) command, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
46
+
To revoke a customer-managed key with Azure CLI, call the [az keyvault key set-attributes](/cli/azure/keyvault/key#az-keyvault-key-set-attributes) command, as shown in the following example. Remember to replace the placeholder values in brackets with your own values to define the variables, or use the variables defined in the previous examples.
33
47
34
48
```azurecli
35
-
az keyvault delete-policy \
36
-
--name <key-vault> \
37
-
--object-id $storage_account_principal
49
+
kvName="<key-vault-name>"
50
+
keyName="<key-name>"
51
+
enabled="false"
52
+
# "false" to disable the key / "true" to enable it:
53
+
54
+
# Check the current state of the key (before and after enabling/disabling it)
0 commit comments