0

I have a variable group where we are keeping all the secret values. In our azure devops pipeline, we want to give user option to provide name of the variable and we will use that value from the variable group.

I know that in pipeline, we use below line to access all variables from a variable group

variables:
  - group: Team-Group-Secrets

but i need to access a variable by name. we ask parameter from user, let's say - secretVarName. I want to get secret value for that variable name, but i could not find the right syntax or way to do it. I also tried this: ${{ variables.$(secretVarName) }}, but it is not working.

This question is also not related to my question: Dynamic variable group in azure

James Z
  • 12,209
  • 10
  • 24
  • 44
Sukhbir
  • 553
  • 8
  • 23
  • Use a parameter for this and then access the parameter name as `${{ parameters.parameterName }}`. – Daniel Mann Jul 04 '23 at 19:32
  • I don't think there is a way to do what you are trying to do. Also, I don't really see a use case for what you are trying to achieve. Can you explain why you want to achieve it this way and not just use different variable groups? – Silvan Jul 04 '23 at 19:38
  • I dont know why question is closed. It's not at all related to any other question posted on stack overflow before this. I searched a lot. This is a separate use case – Sukhbir Jul 04 '23 at 20:24
  • 1
    @Sukhbir If you're saying the other question isn't related, you'll need to explain how it's different because as far as I can tell it's exactly the same. – Daniel Mann Jul 05 '23 at 01:08

0 Answers0