Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to output secret uri in ARM template?

I am unable to output the secret URI from my secret resource in my ARM template. Any ideas on how to do that?

like image 377
Identity Avatar asked Feb 10 '17 11:02

Identity


2 Answers

If you mean you want to have it from the KeyVault, try this:

"outputs":{
"mySecretUri": {
  "type": "string",
  "value": "[reference(resourceId('Microsoft.KeyVault/vaults/secrets', parameters('keyVaultName'), parameters('mySecretName'))).secretUri]"
}
}
like image 138
Pascal Naber Avatar answered Oct 11 '22 01:10

Pascal Naber


In my case the secret is a generated value which changes with every ARM deployment.

This requires the specification of the secrets' version number:

"value": "[reference(resourceId('Microsoft.KeyVault/vaults/secrets', parameters('vaultName'), parameters('secrets_secretName'))).secretUriWithVersion]"
like image 24
Koen Goovaerts Avatar answered Oct 11 '22 01:10

Koen Goovaerts