Skip to content

Commit 019298e

Browse files
authored
Merge pull request #107491 from ThomasWeiss/thweiss-cosmosdb-cmk-cli
Added CLI sample for CMK creation
2 parents d0ac8cb + b164848 commit 019298e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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/14/2020
7+
ms.date: 03/12/2020
88
ms.author: thweiss
99
ROBOTS: noindex, nofollow
1010
---
@@ -184,6 +184,22 @@ New-AzResourceGroupDeployment `
184184
-keyVaultKeyUri $keyVaultKeyUri
185185
```
186186

187+
### Using the Azure CLI
188+
189+
When you create a new Azure Cosmos account through the Azure CLI, pass the URI of the Azure Key Vault key that you copied earlier under the **--key-uri** parameter.
190+
191+
```azurecli-interactive
192+
resourceGroupName='myResourceGroup'
193+
accountName='mycosmosaccount'
194+
keyVaultKeyUri = 'https://<my-vault>.vault.azure.net/keys/<my-key>'
195+
196+
az cosmosdb create \
197+
-n $accountName \
198+
-g $resourceGroupName \
199+
--locations regionName='West US 2' failoverPriority=0 isZoneRedundant=False \
200+
--key-uri $keyVaultKeyUri
201+
```
202+
187203
## Frequently asked questions
188204

189205
### Is there any additional charge for using customer-managed keys?

0 commit comments

Comments
 (0)