I am having below bicep which is returning keyvault. I like to access the properties/functions in keyvault in parent bicep. But not sure how to achieve when using it as a module.
- I have keyvault.bicep
resource kv 'Microsoft.KeyVault/vaults@2019-09-01' existing = {
name: kvName
scope: resourceGroup(subscriptionId, kvResourceGroup )
}
output kv1 object=kv
- I have parent.bicep (where keyvault.bicep is included as module)
module kv './keyvault.bicep' = {
name: 'get Secrets'
params: {
subscriptionId: subscriptionId
kvResourceGroup: resourceGroupName
kvName: keyVaultName
}
}
var pwd= kv.outputs.kv1.getSecret('key')
- but getSecret method is unknown in parent bicep
Kindly suggest how to proceed?