title: Azure DevOps check if password exist in KeyVault inside of the following bash script (yml pipeline)
body: <p>E.g. passwordKey = <code>dbPassword</code> it may be or may be not in Azure KeyVault.</p>
  
  <p>The problem is how can I reference a secret variable by using its name which is another variable?</p>
  
  <p><code>$(!passwordKey)</code> does not work :(</p>
  
  <p>Cause inside the bash task var <code>password</code> becomes equal string "$(!passwordKey)" not the value of the <code>dbPassword</code> var.</p>
  
  <pre><code>- task: AzureKeyVault@1
     inputs:
       azureSubscription: 'dev'
       KeyVaultName: '$(KeyVaultName)'
       SecretsFilter: '*'
  
  - task: Bash@3
    displayName: 'Bash checks if $(passwordKey) exists'
    env:
      password: $(!passwordKey)
    inputs:
      targetType: 'inline'
      script: env
  </code></pre>
  
  <p>Thank you for your help!</p>