I have a bicep template and deploying multiple resource and do not want to harcode password for Azure SQL and Synapse. Thought of using secure string params and utilize getSecret function as mentioned below.
https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/key-vault-parameter?tabs=azure-cli
resource kv 'Microsoft.KeyVault/vaults@2023-02-01' existing = {
name: kvName
scope: resourceGroup(subscriptionId, kvResourceGroup )
}
How ever when I try to do a reference for the existing Keyvault as mentioned above I am getting the following error
KeyVaultParameterReferenceNotFound - The specified KeyVault '/subscriptions/abcd-1234-defg-6789/resourceGroups/ABCKeyVaultPRODNERG/providers/Microsoft.KeyVault/vaults/abckeyvaultprodne' could not be found. Please see https://aka.ms/arm-keyvault for usage details.
I did comment the reference and checked with hardcoded passwords its working fine , between the reference resource group and keyvault name have checked using whatIf are exactly same
Alternate Approach
That did not work for me atleast as I deploying at subscription level and cannot modify my bicep. so I started using Azure Key Vault Tast in release pipeline.
But after fetching the values from Key Vault Task not able to use in ARM override template by default the null vaule from bicep params are being passed
#Your build pipeline references an undefined variable named ‘SqlPassword’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references an undefined variable named ‘SywPassword’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
Between when I look the yaml of ARM it shows the variable is not present.
Any suggestions or Help
Thanks