skip to Main Content

I’m using portal to import JSON file which contains key-value pairs. Need help in importing key-valult references.

I prepare a json file like

{
  AppSettings: {
     "testKey": "testValue",
     "testSecrete": "<akv-Reference-TestSecreteKey>"
   }
}

what should I add in place "akv-Reference-TestSecreteKey", so that when I import this file it add as key-vault reference.

While Import I choose:

  1. Type: Configuration File
  2. Code: .Net
    enter image description here

I tried this

{
    "AppSettings": {        
        "Test": "testValue",
            "TestSceret": "@Microsoft.KeyVault(SecretUri=
https://xyz.vault.azure.net/secrets/SecretValue/)"
    }
}

But it added as key-value, with value same as @Microsoft.KeyVault(S…

2

Answers


  1. You can use a Key Vault reference in form @Microsoft.KeyVault({referenceString})

    Example:

    @Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/mysecret/)
    

    Alternatively:

    @Microsoft.KeyVault(VaultName=myvault;SecretName=mysecret)
    
    Login or Signup to reply.
  2. Try it using the actual SecretName –

    {
        "AppSettings": {        
            "testValue": "@Microsoft.KeyVault(SecretUri=https://xyz.vault.azure.net/secrets/SecretValue/)"
        }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search