0

I've created an Azure App Config and am calling the following to add a key / value pair through an Azure Cloud Shell:

az appconfig kv set -n $appConfigName --content-type application/json --key "tenantXYZ:1" --value {\"FilterConfig\":{\"ClientId\":\"GHRYWQAXCFGH\",\"Url\":\"http://localhost:9091\"}}

but i get the following error

parse error

what's the correct syntax for adding a JSON object called FilterConfig with ClientId and Url properties ? I'm able to add this type ok via the Portal but need to be able to do it on the command line also.

auburg
  • 1,373
  • 2
  • 12
  • 22

1 Answers1

0

@auburg, you should put the whole value in quotes

az appconfig kv set -n $appConfigName --content-type application/json --key "tenantXYZ:1" --value "{\"FilterConfig\":{\"ClientId\":\"GHRYWQAXCFGH\",\"Url\":\"http://localhost:9091\"}}"
Zhenlan Wang
  • 1,213
  • 8
  • 10
  • 1
    Yes that and i needed to add additional quotes - this is what i ended up with: "{\""FilterConfig\"":{\""ClientId\"":\""GHRYWQAXCFGH\"",\""Url\"":\""http://localhost:9091\""}}" – auburg Aug 03 '21 at 08:19