-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue] Keyvault references in ARM parameter files are not supported #4706
Comments
@GABRIELNGBTUC thanks for reporting. Can you share format of your keyvault ID, hope its of this format - @JeffreyCA can you triage this? May be AZD is unaware of this key vault referencing in the param file and by default prompting and using it for @secure()? cc @vhvb1989 |
I was able to repro the issue as well. I tried debugging a little and it looks like when
but not KeyVault references like:
There might be more going on, but from my initial findings these may be relevant: azure-dev/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go Lines 1524 to 1527 in ad53ef2
azure-dev/cli/azd/pkg/azure/arm_parameters.go Lines 1 to 20 in ad53ef2
And a similar issue I found: #1474 |
The equivalent of Key Vault references for main.bicepparam (replacing main.parameters.json) using 'main.bicep'
param environmentName = readEnvironmentVariable('AZURE_ENV_NAME')
param location = readEnvironmentVariable('AZURE_LOCATION')
param test_kv = az.getSecret('<subscription>', '<rg>', '<vault name>', 'test-kv')
|
azd does not support this using keyvault references like this, @GABRIELNGBTUC The You can try these workarounds: A) Add a default value to your parameter in B) You can make azd to pull the value from the KeyVault secret before sending the ARM template. You can do this by using this syntaxis in the main.parameters.json: "test_kv": {
"value": "$(secretOrRandomPassword ${AZURE_KEY_VAULT_NAME} test-kv)"
}, You can either set The FIX we need for azd: We need to schedule and plan a fix where azd checks if there is a keyvault secret reference definition for a parameter and if yes, skip the prompt. This might take a few days to have it fixed, so you can try the workarounds if you are blocked. Otherwise you can wait for the fix in a future azd release |
Output from
azd version
Run
azd version
and copy and paste the output here:azd version 1.11.0 (commit 5b92e06)
Describe the bug
When deploying the infrastructure with a parameter file making use of keyvault references, azd prompts the user to input a value for the parameter and overrides the value instead of fetching the value from the referenced keyvault + secret name combination.
To Reproduce
test_kv
parameter. Enter a value different from what is in the keyvaulttest
reuses the value provided at step 6 instead of the value of the keyvault set at step 3Expected behavior
Keyvault references in JSON parameter files are supported and treated the same way as parameters defined with the
value
property, instead of being hijacked by the AZD cliEnvironment
Information on your environment:
Additional context
The error caused when using the
--no-prompt
switch is also unclear but covered by the issue #3795The text was updated successfully, but these errors were encountered: