How to create key vault secret with multiple values in one secret?

Viewed 4320

I want to create a secret in the azure key vault which will be having multiple keys (like JSON).

e.g-

{
  "storageAccountKey":"XXXXX",
  "CognitiveServicesKey":"XXXX",
  "XXXXXx":"XXXX",
}

is it possible to create?

And then by using PowerShell script, I want to update a particular key in the above-created secret with a new one. Please help me.

2 Answers

Yes, it is possible. You will need to upload the content of a file as a secret. It can be done via the Azure CLI as follow:

az keyvault secret set --name [SECRET-NAME] --vault-name [VAULT_NAME] --file C:\path\to\file.txt --subscription [AZURE-SUBSCRIPTION-ID]

If we will do that....it will reduce large number of calls to the KeyVault services. I didn't understand how it will be a security threat if we use multiple keys in single secret.

Related