Forum Discussion

tanulbhasin's avatar
tanulbhasin
Brass Contributor
Mar 22, 2023

Using expression in Azure key vault task?

Hello,

 

This is giving invalid key vault name. Does Azure key vault task accepts expression. If not then how to pass the value to azure key vault in such scenario

 

variables:
- group: env_map
- name: qaNamespace
  value: $[coalesce(variables[variables['Build.SourceBranch']], '')]
 


- task: AzureKeyVault@2
displayName: Download Secrets from Key Vault
inputs:
azureSubscription: ${{parameters.azureSubscription}}
KeyVaultName: replace(replace(replace(variables['qaNamespace'], 'a', 'vault1'), 'b', 'vault2'), 'c', 'vault3')
SecretsFilter: 'PASSWORD,UserID'
RunAsPreJob: false

 

No RepliesBe the first to reply