0

I'm trying to import a json file into Azure app configuration service using cli command: az appconfig kv import.

Sample json file

{
    "Pss": {
        "account/getall/get": "read",
        "account/setall/put": "write",
        "account/someendpoint/somevalue": "profile"
    }
}

I can see below preview in cli

Adding:
{"key": "Pss:account/getall/get", "value": "\"read\""}
{"key": "Pss:account/setall/put", "value": "\"write\""}
{"key": "Pss:account/someendpoint/somevalue", "value": "\"profile\""}

Labels are created as (No label) in app configuration service.

enter image description here

Could you please suggest to me what changes need to be done in the json file to generate label values?

Thanks in advance.

Madhu
  • 415
  • 1
  • 4
  • 15

1 Answers1

1

Below command will helps you to get the label name:

az appconfig kv import --name hkappconfig --label testingLabelName --source file --path /home/hari/Import.json --format json --separator . --content-type "application/json

enter image description here

By adding the attribute --label labelName in the Importing az cli command, You will get the label name in the configuration explorer of the app configuration.

Output:

enter image description here

  • 1
    @[Hari Krishna] Can you please also explain how to add labels to individual keys? Let's Say I have an app.json file with { "key1" :"value1","label" :"blue"} and I have 100+ keys in the json file which I have to add to appConfig. – Lakshman Sep 26 '22 at 15:18
  • Hello @Lakshman, Could you please post as a new question! –  Sep 26 '22 at 17:30