Support Key Vault references in Bicep and JSON parameter files#4744
Conversation
weikanglim
left a comment
There was a problem hiding this comment.
LGTM. I really appreciate how clean these changes were. It really helped highlight to me the idea of how much of azd interpreting bicepparam / ARM files are really "passthrough changes to the ARM control plane".
I also really like that the existing code allowed us to add this change simply without affecting how param prompting works in azd.
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
vhvb1989
left a comment
There was a problem hiding this comment.
LGTM.
Just adding a question about if we should be parsing the key vault reference or not.
Fixes #4706
This PR adds support for Key Vault references in parameter files, so you can now define a
paraminmain.bicepthat has a key vault reference (instead of a simple value) inmain.bicepparamormain.parameters.json.The issue was that when deserializing the
main.parameters.jsonfile, the model type used did not have the necessary fields for key vault references. As a result, theValuefield would beniland causeazdto prompt the user for a value, ignoring the value in the Key Vault secret.Example
main.bicep:
main.bicepparam:
main.parameters.json:
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "kvSecret": { "reference": { "keyVault": { "id": "/subscriptions/<subscription>/resourceGroups/<resource group>/providers/Microsoft.KeyVault/vaults/<vault>" }, "secretName": "testsecret" } } } }Validation
Tested
azd upon sample code that uses Bicep and JSON parameter files with KV references and confirmed that the secret value flowed through to the deployment output.Also tested with
alpha.deployment.stacksset toonandoff.