Skip to content

Commit ad335be

Browse files
authored
Merge pull request #100103 from tamram/tamram-0102
add new sections for CMK configuration
2 parents 21c514b + bc60c43 commit ad335be

File tree

5 files changed

+87
-29
lines changed

5 files changed

+87
-29
lines changed

articles/storage/common/storage-encryption-key-model-get.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: tamram
77

88
ms.service: storage
99
ms.topic: how-to
10-
ms.date: 11/26/2019
10+
ms.date: 01/03/2020
1111
ms.author: tamram
1212
ms.reviewer: cbrooks
1313
ms.subservice: common

articles/storage/common/storage-encryption-keys-cli.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: tamram
77

88
ms.service: storage
99
ms.topic: how-to
10-
ms.date: 12/04/2019
10+
ms.date: 01/03/2019
1111
ms.author: tamram
1212
ms.reviewer: cbrooks
1313
ms.subservice: common
@@ -19,10 +19,6 @@ ms.subservice: common
1919

2020
This article shows how to configure an Azure Key Vault with customer-managed keys using Azure CLI. To learn how to create a key vault using Azure CLI, see [Quickstart: Set and retrieve a secret from Azure Key Vault using Azure CLI](../../key-vault/quick-create-cli.md).
2121

22-
> [!IMPORTANT]
23-
> Using customer-managed keys with Azure Storage encryption requires that two properties be set on the key vault, **Soft Delete** and **Do Not Purge**. These properties are not enabled by default. To enable these properties, use either PowerShell or Azure CLI.
24-
> Only RSA keys and key size 2048 are supported.
25-
2622
## Assign an identity to the storage account
2723

2824
To enable customer-managed keys for your storage account, first assign a system-assigned managed identity to the storage account. You'll use this managed identity to grant the storage account permissions to access the key vault.
@@ -42,7 +38,7 @@ For more information about configuring system-assigned managed identities with A
4238

4339
## Create a new key vault
4440

45-
The key vault that you use to store customer-managed keys for Azure Storage encryption must have two key protection settings enabled, **Soft Delete** and **Do Not Purge**. To create a new key vault using PowerShell or Azure CLI with these settings enabled, execute the following commands. Remember to replace the placeholder values in brackets with your own values.
41+
The key vault that you use to store customer-managed keys for Azure Storage encryption must have two key protection settings enabled, **Soft Delete** and **Do Not Purge**. To create a new key vault using PowerShell or Azure CLI with these settings enabled, execute the following commands. Remember to replace the placeholder values in brackets with your own values.
4642

4743
To create a new key vault using Azure CLI, call [az keyvault create](/cli/azure/keyvault#az-keyvault-create). Remember to replace the placeholder values in brackets with your own values.
4844

@@ -55,6 +51,8 @@ az keyvault create \
5551
--enable-purge-protection
5652
```
5753

54+
To learn how to enable **Soft Delete** and **Do Not Purge** on an existing key vault with Azure CLI, see the sections titled **Enabling soft-delete** and **Enabling Purge Protection** in [How to use soft-delete with CLI](../../key-vault/key-vault-soft-delete-cli.md).
55+
5856
## Configure the key vault access policy
5957

6058
Next, configure the access policy for the key vault so that the storage account has permissions to access it. In this step, you'll use the managed identity that you previously assigned to the storage account.
@@ -88,7 +86,7 @@ az keyvault key create
8886

8987
By default, Azure Storage encryption uses Microsoft-managed keys. Configure your Azure Storage account for customer-managed keys and specify the key to associate with the storage account.
9088

91-
To update the storage account's encryption settings, call [az storage account update](/cli/azure/storage/account#az-storage-account-update). This example also queries for the key vault URI and the latest key version, both of which values are needed to associate the key with the storage account. Remember to replace the placeholder values in brackets with your own values.
89+
To update the storage account's encryption settings, call [az storage account update](/cli/azure/storage/account#az-storage-account-update), as shown in the following example. Include the `--encryption-key-source` parameter and set it to `Microsoft.Keyvault` to enable customer-managed keys for the storage account. The example also queries for the key vault URI and the latest key version, both of which values are needed to associate the key with the storage account. Remember to replace the placeholder values in brackets with your own values.
9290

9391
```azurecli-interactive
9492
key_vault_uri=$(az keyvault show \
@@ -101,7 +99,7 @@ key_version=$(az keyvault key list-versions \
10199
--vault-name <key-vault> \
102100
--query [-1].kid \
103101
--output tsv | cut -d '/' -f 6)
104-
az storage account update
102+
az storage account update
105103
--name <storage-account> \
106104
--resource-group <resource_group> \
107105
--encryption-key-name <key> \
@@ -114,6 +112,21 @@ az storage account update
114112

115113
When you create a new version of a key, you'll need to update the storage account to use the new version. First, query for the key vault URI by calling [az keyvault show](/cli/azure/keyvault#az-keyvault-show), and for the key version by calling [az keyvault key list-versions](/cli/azure/keyvault/key#az-keyvault-key-list-versions). Then call [az storage account update](/cli/azure/storage/account#az-storage-account-update) to update the storage account's encryption settings to use the new version of the key, as shown in the previous section.
116114

115+
## Use a different key
116+
117+
To change the key used for Azure Storage encryption, call [az storage account update](/cli/azure/storage/account#az-storage-account-update) as shown in [Configure encryption with customer-managed keys](#configure-encryption-with-customer-managed-keys) and provide the new key name and version. If the new key is in a different key vault, also update the key vault URI.
118+
119+
## Disable customer-managed keys
120+
121+
When you disable customer-managed keys, your storage account is then encrypted with Microsoft-managed keys. To disable customer-managed keys, 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.
122+
123+
```powershell
124+
az storage account update
125+
--name <storage-account> \
126+
--resource-group <resource_group> \
127+
--encryption-key-source Microsoft.Storage
128+
```
129+
117130
## Next steps
118131

119132
- [Azure Storage encryption for data at rest](storage-service-encryption.md)

articles/storage/common/storage-encryption-keys-portal.md

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: tamram
77

88
ms.service: storage
99
ms.topic: how-to
10-
ms.date: 12/04/2019
10+
ms.date: 01/02/2020
1111
ms.author: tamram
1212
ms.reviewer: cbrooks
1313
ms.subservice: common
@@ -19,9 +19,16 @@ ms.subservice: common
1919

2020
This article shows how to configure an Azure Key Vault with customer-managed keys using the [Azure portal](https://portal.azure.com/). To learn how to create a key vault using the Azure portal, see [Quickstart: Set and retrieve a secret from Azure Key Vault using the Azure portal](../../key-vault/quick-create-portal.md).
2121

22-
> [!IMPORTANT]
23-
> Using customer-managed keys with Azure Storage encryption requires that two properties be set on the key vault, **Soft Delete** and **Do Not Purge**. These properties are not enabled by default. To enable these properties, use either PowerShell or Azure CLI.
24-
> Only RSA keys and key size 2048 are supported.
22+
## Configure Azure Key Vault
23+
24+
Using customer-managed keys with Azure Storage encryption requires that two properties be set on the key vault, **Soft Delete** and **Do Not Purge**. These properties are not enabled by default, but can be enabled using either PowerShell or Azure CLI on a new or existing key vault.
25+
26+
To learn how to enable these properties on an existing key vault, see the sections titled **Enabling soft-delete** and **Enabling Purge Protection** in one of the following articles:
27+
28+
- [How to use soft-delete with PowerShell](../../key-vault/key-vault-soft-delete-powershell.md).
29+
- [How to use soft-delete with CLI](../../key-vault/key-vault-soft-delete-cli.md).
30+
31+
Only RSA keys of size 2048 are supported with Azure Storage encryption. For more information about keys, see **Key Vault keys** in [About Azure Key Vault keys, secrets and certificates](../../key-vault/about-keys-secrets-and-certificates.md#key-vault-keys).
2532

2633
## Enable customer-managed keys
2734

@@ -40,31 +47,53 @@ After you enable customer-managed keys, you'll have the opportunity to specify a
4047

4148
To specify a key as a URI, follow these steps:
4249

43-
1. To locate the key URI in the Azure portal, navigate to your key vault, and select the **Keys** setting. Select the desired key, then click the key to view its settings. Copy the value of the **Key Identifier** field, which provides the URI.
50+
1. To locate the key URI in the Azure portal, navigate to your key vault, and select the **Keys** setting. Select the desired key, then click the key to view its versions. Select a key version to view the settings for that version.
51+
1. Copy the value of the **Key Identifier** field, which provides the URI.
4452

4553
![Screenshot showing key vault key URI](media/storage-encryption-keys-portal/key-uri-portal.png)
4654

4755
1. In the **Encryption** settings for your storage account, choose the **Enter key URI** option.
48-
1. In the **Key URI** field, specify the URI.
56+
1. Paste the URI that you copied into the **Key URI** field.
4957

5058
![Screenshot showing how to enter key URI](./media/storage-encryption-keys-portal/ssecmk2.png)
5159

60+
1. Specify the subscription that contains the key vault.
61+
1. Save your changes.
62+
5263
### Specify a key from a key vault
5364

5465
To specify a key from a key vault, first make sure that you have a key vault that contains a key. To specify a key from a key vault, follow these steps:
5566

5667
1. Choose the **Select from Key Vault** option.
57-
2. Choose the key vault containing the key you want to use.
58-
3. Choose the key from the key vault.
68+
2. Select the key vault containing the key you want to use.
69+
3. Select the key from the key vault.
5970

6071
![Screenshot showing customer-managed key option](./media/storage-encryption-keys-portal/ssecmk3.png)
6172

73+
1. Save your changes.
74+
6275
## Update the key version
6376

64-
When you create a new version of a key, you'll need to update the storage account to use the new version. Follow these steps:
77+
When you create a new version of a key, update the storage account to use the new version. Follow these steps:
78+
79+
1. Navigate to your storage account and display the **Encryption** settings.
80+
1. Enter the URI for the new key version. Alternately, you can select the key vault and the key again to update the version.
81+
1. Save your changes.
82+
83+
## Use a different key
84+
85+
To change the key used for Azure Storage encryption, follow these steps:
86+
87+
1. Navigate to your storage account and display the **Encryption** settings.
88+
1. Enter the URI for the new key. Alternately, you can select the key vault and choose a new key.
89+
1. Save your changes.
90+
91+
## Disable customer-managed keys
92+
93+
When you disable customer-managed keys, your storage account is then encrypted with Microsoft-managed keys. To disable customer-managed keys, follow these steps:
6594

6695
1. Navigate to your storage account and display the **Encryption** settings.
67-
1. Specify the URI for the new key version. Alternately, you can select the key vault and the key again to update the version.
96+
1. Deselect the checkbox next to the **Use your own key** setting.
6897

6998
## Next steps
7099

articles/storage/common/storage-encryption-keys-powershell.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: tamram
77

88
ms.service: storage
99
ms.topic: how-to
10-
ms.date: 12/04/2019
10+
ms.date: 01/03/2019
1111
ms.author: tamram
1212
ms.reviewer: cbrooks
1313
ms.subservice: common
@@ -19,10 +19,6 @@ ms.subservice: common
1919

2020
This article shows how to configure an Azure Key Vault with customer-managed keys using PowerShell. To learn how to create a key vault using Azure CLI, see [Quickstart: Set and retrieve a secret from Azure Key Vault using PowerShell](../../key-vault/quick-create-powershell.md).
2121

22-
> [!IMPORTANT]
23-
> Using customer-managed keys with Azure Storage encryption requires that two properties be set on the key vault, **Soft Delete** and **Do Not Purge**. These properties are not enabled by default. To enable these properties, use either PowerShell or Azure CLI.
24-
> Only RSA keys and key size 2048 are supported.
25-
2622
## Assign an identity to the storage account
2723

2824
To enable customer-managed keys for your storage account, first assign a system-assigned managed identity to the storage account. You'll use this managed identity to grant the storage account permissions to access the key vault.
@@ -39,9 +35,9 @@ For more information about configuring system-assigned managed identities with P
3935

4036
## Create a new key vault
4137

42-
To create a new key vault using PowerShell, call [New-AzKeyVault](/powershell/module/az.keyvault/new-azkeyvault). The key vault that you use to store customer-managed keys for Azure Storage encryption must have two key protection settings enabled, **Soft Delete** and **Do Not Purge**.
38+
To create a new key vault using PowerShell, call [New-AzKeyVault](/powershell/module/az.keyvault/new-azkeyvault). The key vault that you use to store customer-managed keys for Azure Storage encryption must have two key protection settings enabled, **Soft Delete** and **Do Not Purge**.
4339

44-
Remember to replace the placeholder values in brackets with your own values.
40+
Remember to replace the placeholder values in brackets with your own values.
4541

4642
```powershell
4743
$keyVault = New-AzKeyVault -Name <key-vault> `
@@ -51,6 +47,8 @@ $keyVault = New-AzKeyVault -Name <key-vault> `
5147
-EnablePurgeProtection
5248
```
5349

50+
To learn how to enable **Soft Delete** and **Do Not Purge** on an existing key vault with PowerShell, see the sections titled **Enabling soft-delete** and **Enabling Purge Protection** in [How to use soft-delete with PowerShell](../../key-vault/key-vault-soft-delete-powershell.md).
51+
5452
## Configure the key vault access policy
5553

5654
Next, configure the access policy for the key vault so that the storage account has permissions to access it. In this step, you'll use the managed identity that you previously assigned to the storage account.
@@ -76,7 +74,7 @@ $key = Add-AzKeyVaultKey -VaultName $keyVault.VaultName -Name <key> -Destination
7674

7775
By default, Azure Storage encryption uses Microsoft-managed keys. In this step, configure your Azure Storage account to use customer-managed keys and specify the key to associate with the storage account.
7876

79-
Call [Set-AzStorageAccount](/powershell/module/az.storage/set-azstorageaccount) to update the storage account's encryption settings. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
77+
Call [Set-AzStorageAccount](/powershell/module/az.storage/set-azstorageaccount) to update the storage account's encryption settings, as shown in the following example. Include the **-KeyvaultEncryption** option to enable customer-managed keys for the storage account. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
8078

8179
```powershell
8280
Set-AzStorageAccount -ResourceGroupName $storageAccount.ResourceGroupName `
@@ -91,6 +89,20 @@ Set-AzStorageAccount -ResourceGroupName $storageAccount.ResourceGroupName `
9189

9290
When you create a new version of a key, you'll need to update the storage account to use the new version. First, call [Get-AzKeyVaultKey](/powershell/module/az.keyvault/get-azkeyvaultkey) to get the latest version of the key. Then call [Set-AzStorageAccount](/powershell/module/az.storage/set-azstorageaccount) to update the storage account's encryption settings to use the new version of the key, as shown in the previous section.
9391

92+
## Use a different key
93+
94+
To change the key used for Azure Storage encryption, call [Set-AzStorageAccount](/powershell/module/az.storage/set-azstorageaccount) as shown in [Configure encryption with customer-managed keys](#configure-encryption-with-customer-managed-keys) and provide the new key name and version. If the new key is in a different key vault, also update the key vault URI.
95+
96+
## Disable customer-managed keys
97+
98+
When you disable customer-managed keys, your storage account is then encrypted with Microsoft-managed keys. To disable customer-managed keys, 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.
99+
100+
```powershell
101+
Set-AzStorageAccount -ResourceGroupName $storageAccount.ResourceGroupName `
102+
-AccountName $storageAccount.StorageAccountName `
103+
-StorageEncryption
104+
```
105+
94106
## Next steps
95107

96108
- [Azure Storage encryption for data at rest](storage-service-encryption.md)

articles/storage/common/storage-service-encryption.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: storage
55
author: tamram
66

77
ms.service: storage
8-
ms.date: 12/05/2019
8+
ms.date: 01/03/2020
99
ms.topic: conceptual
1010
ms.author: tamram
1111
ms.reviewer: cbrooks
@@ -76,10 +76,12 @@ The following list explains the numbered steps in the diagram:
7676

7777
### Enable customer-managed keys for a storage account
7878

79-
When you enable encryption with customer-managed keys for a storage account, Azure Storage wraps the account encryption key with the customer key in the associated key vault. Enabling customer-managed keys does not impact performance, and the account is encrypted with the new key immediately, without any time delay.
79+
When you enable encryption with customer-managed keys for a storage account, Azure Storage wraps the account encryption key with the customer-managed key in the associated key vault. Enabling customer-managed keys does not impact performance, and the account is encrypted with the new key immediately, without any time delay.
8080

8181
A new storage account is always encrypted using Microsoft-managed keys. It's not possible to enable customer-managed keys at the time that the account is created. Customer-managed keys are stored in Azure Key Vault, and the key vault must be provisioned with access policies that grant key permissions to the managed identity that is associated with the storage account. The managed identity is available only after the storage account is created.
8282

83+
When you modify the key being used for Azure Storage encryption by enabling or disabling customer-managed keys, updating the key version, or specifying a different key, then the encryption of the root key changes, but the data in your Azure Storage account does not need to be re-encrypted.
84+
8385
To learn how to use customer-managed keys with Azure Key Vault for Azure Storage encryption, see one of these articles:
8486

8587
- [Configure customer-managed keys with Key Vault for Azure Storage encryption from the Azure portal](storage-encryption-keys-portal.md)
@@ -93,6 +95,8 @@ To learn how to use customer-managed keys with Azure Key Vault for Azure Storage
9395

9496
To enable customer-managed keys on a storage account, you must use an Azure Key Vault to store your keys. You must enable both the **Soft Delete** and **Do Not Purge** properties on the key vault.
9597

98+
Only RSA keys of size 2048 are supported with Azure Storage encryption. For more information about keys, see **Key Vault keys** in [About Azure Key Vault keys, secrets and certificates](../../key-vault/about-keys-secrets-and-certificates.md#key-vault-keys).
99+
96100
The key vault must be located in the same subscription as the storage account. Azure Storage uses managed identities for Azure resources to authenticate to the key vault for encryption and decryption operations. Managed identities do not currently support cross-directory scenarios.
97101

98102
### Rotate customer-managed keys

0 commit comments

Comments
 (0)