Skip to content

Commit e822cff

Browse files
Merge pull request #100895 from ThomasWeiss/thweiss-cosmosdb-cmk-fixes
Various fixes to Cosmos DB CMK setup article
2 parents 9bc6031 + 793b9ed commit e822cff

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

articles/cosmos-db/how-to-setup-cmk.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ description: Learn how to configure customer-managed keys for your Azure Cosmos
44
author: ThomasWeiss
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 01/09/2020
7+
ms.date: 01/11/2020
88
ms.author: thweiss
9+
ROBOTS: noindex, nofollow
910
---
1011

1112
# Configure customer-managed keys for your Azure Cosmos DB account
@@ -25,13 +26,13 @@ Currently, customer-managed keys are only available for new accounts and need to
2526

2627
### 1. Make sure the Azure Cosmos DB resource provider is registered for your Azure subscription
2728

28-
From the Azure portal, go to your Azure subscription and select "Resource providers" from the left menu:
29+
From the Azure portal, go to your Azure subscription and select **Resource providers** from the left menu:
2930

3031
!["Resource providers" entry from the left menu](./media/how-to-setup-cmk/portal-rp.png)
3132

32-
Search for the "Microsoft.DocumentDB" resource provider.
33+
Search for the **Microsoft.DocumentDB** resource provider.
3334
- If the resource provider is already marked as registered, nothing needs to be done.
34-
- If not, select it and click on "Register":
35+
- If not, select it and click on **Register**:
3536

3637
![Registering the Microsoft.DocumentDB resource provider](./media/how-to-setup-cmk/portal-rp-register.png)
3738

@@ -45,51 +46,54 @@ To learn how to enable these properties on an existing Azure Key Vault instance,
4546

4647
### 3. Add an access policy to your Azure Key Vault instance
4748

48-
From the Azure portal, go to the Azure Key Vault instance you plan to use to host your encryption keys. Then, select "Access Policies" from the left menu:
49+
From the Azure portal, go to the Azure Key Vault instance you plan to use to host your encryption keys. Then, select **Access Policies** from the left menu:
4950

5051
!["Access policies" from the left menu](./media/how-to-setup-cmk/portal-akv-ap.png)
5152

52-
- Click on "+ Add Access Policy"
53-
- Under the "Key permissions" dropdown menu, select "Get", "Unwrap Key" and "Wrap Key":
53+
- Select **+ Add Access Policy**
54+
- Under the **Key permissions** dropdown menu, select **Get**, **Unwrap Key** and **Wrap Key**:
5455

5556
![Selecting the right permissions](./media/how-to-setup-cmk/portal-akv-add-ap-perm2.png)
5657

57-
- Under "Select principal", click on "None selected", search for and select the "Azure Cosmos DB" principal, then click "Select" at the bottom (if the "Azure Cosmos DB" principal can't be found, you may need to re-register the "Microsoft.DocumentDB" resource provider at step 2):
58+
- Under **Select principal**, select **None selected**. Then, search for and select the **Azure Cosmos DB** principal. Finally, click **Select** at the bottom (if the **Azure Cosmos DB** principal can't be found, you may need to re-register the **Microsoft.DocumentDB** resource provider at step 1):
5859

5960
![Selecting the Azure Cosmos DB principal](./media/how-to-setup-cmk/portal-akv-add-ap.png)
6061

61-
- Click "Add" to add the new access policy
62+
- Select **Add** to add the new access policy
6263

6364
### 4. Generate a key in Azure Key Vault
6465

65-
From the Azure portal, go the Azure Key Vault instance you plan to use to host your encryption keys. Then, select "Keys" from the left menu:
66+
From the Azure portal, go the Azure Key Vault instance you plan to use to host your encryption keys. Then, select **Keys** from the left menu:
6667

6768
!["Keys" entry from the left menu](./media/how-to-setup-cmk/portal-akv-keys.png)
6869

69-
- Click on "Generate/Import"
70-
- Provide a name for the new key, select an RSA key size (a minimum of 3072 is recommended for best security) and click "Create":
70+
- Select **Generate/Import**
71+
- Provide a name for the new key, select an RSA key size (a minimum of 3072 is recommended for best security) and select **Create**:
7172

7273
![Creating a new key](./media/how-to-setup-cmk/portal-akv-gen.png)
7374

7475
- Once the key is created, click on the newly created key, then on its current version
75-
- Copy the key’s "Key Identifier" except the part after the last forward slash:
76+
- Copy the key’s **Key Identifier** except the part after the last forward slash:
7677

7778
![Copying the key's key identifier](./media/how-to-setup-cmk/portal-akv-keyid.png)
7879

7980
### 5. Create a new Azure Cosmos DB account
8081

8182
#### Using the Azure portal
8283

83-
When creating a new Azure Cosmos DB account from the Azure portal, choose "Customer-managed key" at the "Encryption" step. In the "Key URI" field, pass the URI of the Azure Key Vault key copied from step 4:
84+
When creating a new Azure Cosmos DB account from the Azure portal, choose **Customer-managed key** at the **Encryption** step. In the **Key URI** field, pass the URI of the Azure Key Vault key copied from step 4:
8485

8586
![Setting CMK parameters in the Azure portal](./media/how-to-setup-cmk/portal-cosmos-enc.png)
8687

8788
#### Using PowerShell
8889

8990
When creating a new Azure Cosmos DB account with PowerShell,
90-
- pass the URI of the Azure Key Vault key copied from step 4 under the "keyVaultKeyUri" property in the "PropertyObject",
91+
- pass the URI of the Azure Key Vault key copied from step 4 under the **keyVaultKeyUri** property in the **PropertyObject**,
9192
- make sure to use "2019-12-12" as the API version.
9293

94+
> [!IMPORTANT]
95+
> The `Location` parameter has to be set explicitly for the account to be successfully created with CMK.
96+
9397
```powershell
9498
$resourceGroupName = "myResourceGroup"
9599
$accountLocation = "West US 2"
@@ -113,10 +117,13 @@ New-AzResource -ResourceType "Microsoft.DocumentDb/databaseAccounts" `
113117
#### Using Azure Resource Manager templates
114118

115119
When creating a new Azure Cosmos DB account through an Azure Resource Manager template:
116-
- pass the URI of the Azure Key Vault key copied from step 4 under the "keyVaultKeyUri" property in the "properties" object
120+
- pass the URI of the Azure Key Vault key copied from step 4 under the **keyVaultKeyUri** property in the **properties** object
117121
- make sure to use "2019-12-12" as the API version
118122

119-
```
123+
> [!IMPORTANT]
124+
> The `location` parameter has to be set explicitly for the account to be successfully created with CMK.
125+
126+
```json
120127
{
121128
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
122129
"contentVersion": "1.0.0.0",
-6 Bytes
Loading

0 commit comments

Comments
 (0)