How to securely add a secret to the key vault

Category: azure key vault

Question

devops_sl on Wed, 27 Mar 2019 09:58:07


Hi

I'm using arm templates to create a vpn which needs a secret to create the connection.

As a first step I create a key vault using arm templates. The secret is a string value which is already generated and provided to me.

I want to create a secret in the key vault with the value. I can't save the secret value in the repo, how can I put this secret value securely before it can be added using arm templates .

Any thoughts please ?

Replies

SaurabhSharma-MSFT on Wed, 27 Mar 2019 20:56:00


You can use a parameter file for the template and reference the secret from Azure Key Vault by passing the static resource identifier of the key vault and name of the secret.  In case you need to reference a Key vault secret of a dynamically created key vault id you can use a linked template approach where you add a linked template to a parent template and pass the dynamically created resource id of Azure Key Vault as a parameter.  Please refer to these documents for details - 

SaurabhSharma-MSFT on Wed, 03 Apr 2019 23:42:11


Please let me know if you find above reply useful. If yes, do click on 'Mark as answer' link in above reply. This will help other community members facing similar query to refer to this solution. Thanks.