Skip to content

Commit 5ccf30a

Browse files
committed
Adding Key Vault reference info to CLI samples
1 parent 8d17d69 commit 5ccf30a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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"
@@ -51,9 +54,24 @@ az appconfig kv set --name $appConfigName --value "Value 2"
5154
# List current key-values
5255
az appconfig kv list --name $appConfigName
5356
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\"}"
65+
66+
# List current key-values
67+
az appconfig kv list --name $appConfigName
68+
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)