Skip to content

Commit 8690536

Browse files
authored
Merge pull request #95456 from lisaguthrie/5709492-kv-cli
Adding Key Vault reference info to CLI samples
2 parents fe4d279 + 157d588 commit 8690536

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

articles/azure-app-configuration/scripts/cli-work-with-keys.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ title: Azure CLI Script Sample - Work with key-values in an Azure App Configurat
33
description: Provides information on working with key-values in an Azure App Configuration store
44
services: azure-app-configuration
55
documentationcenter: ''
6-
author: yegu-ms
7-
manager: balans
6+
author: lisaguthrie
7+
manager: maiye
88
editor: ''
99

1010
ms.service: azure-app-configuration
1111
ms.devlang: azurecli
1212
ms.topic: sample
1313
ms.tgt_pltfrm: na
1414
ms.workload: azure-app-configuration
15-
ms.date: 02/24/2019
16-
ms.author: yegu
15+
ms.date: 11/08/2019
16+
ms.author: lcozzens
1717
ms.custom: mvc
1818
---
1919

@@ -38,6 +38,9 @@ You need to install the Azure App Configuration CLI extension first by executing
3838
3939
appConfigName=myTestAppConfigStore
4040
newKey="TestKey"
41+
refKey="KeyVaultReferenceTestKey"
42+
uri="[URL to value stored in Key Vault]"
43+
uri2="[URL to another value stored in Key Vault]"
4144
4245
# Create a new key-value
4346
az appconfig kv set --name $appConfigName --key $newKey --value "Value 1"
@@ -46,14 +49,29 @@ az appconfig kv set --name $appConfigName --key $newKey --value "Value 1"
4649
az appconfig kv list --name $appConfigName
4750
4851
# Update new key's value
49-
az appconfig kv set --name $appConfigName --value "Value 2"
52+
az appconfig kv set --name $appConfigName --key $newKey --value "Value 2"
53+
54+
# List current key-values
55+
az appconfig kv list --name $appConfigName
56+
57+
# Create a new key-value referencing a value stored in Azure Key Vault
58+
az appconfig kv set --name $appConfigName --key $refKey --content-type "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8" --value "{\"uri\":\"$uri\"}"
59+
60+
# List current key-values
61+
az appconfig kv list --name $appConfigName
62+
63+
# Update Key Vault reference
64+
az appconfig kv set --name $appConfigName --key $refKey --value "{\"uri\":\"$uri2\"}"
5065
5166
# List current key-values
5267
az appconfig kv list --name $appConfigName
5368
5469
# Delete new key
5570
az appconfig kv delete --name $appConfigName --key $newKey
5671
72+
# Delete Key Vault reference
73+
az appconfig kv delete --name $appConfigName --key $refKey
74+
5775
# List current key-values
5876
az appconfig kv list --name $appConfigName
5977
```

0 commit comments

Comments
 (0)