Pass variable group name from a variable value

Raj D 616 Reputation points
2023-03-05T17:33:36.07+00:00

Greetings!!!

In my azure devops pipeline I would like to make the variable group name dynamic and would want to read the value from a variable defined.

.yaml

variables:

- group: my-variable-group

For instance I have the variable group name hard coded and would like to change it as below. Then I run into unexpected value error

variables:

- group: $(my-variable-group)

Thank you

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 34,551 Reputation points Microsoft Employee Moderator
    2023-03-07T14:48:32.4133333+00:00

    @Raj D ,

    Thankyou for using Microsoft Q&A platform and thanks for posting your query here.

    I understand you want to know how to make variable groups dynamic while performing deployment using yaml file.

    You could try defining variables with the following syntax and see if it helps:

    variables:
      a: ${{ <expression> }}
      b: $[ <expression> ]
    

    Kindly check if the following documentations help in your scenario:


    Hope it helps. Please do consider clicking Accept Answer as accepted answers help community as well. Also, please click on Yes for the survey 'Was the answer helpful'

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.