Azure DevOps–Using Variable Groups

I was in a webinar recently and saw a note about variable groups. That looked interesting, as I’ve started to find that I may have lots of variables in some pipelines, and I thought this would keep me organized. However, these are better than that.

When I go to the variable screen for a pipeline, I see this my variables, but on the left side, I see “Variable groups”. If I click this, I see some info.:

2020-10-21 14_54_57-Release SimpleTalkDB - Pipelines

The top link takes me to a doc page, where I see this sentence: “Use a variable group to store values that you want to control and make available across multiple pipelines.

Now that is interesting. I have been thinking about different pipelines, so having variables that work across them is good.

To create a variable group, I need to go to the Library, which is another menu item under the Pipelines area. I get a list of groups, of which I have none right now.

2020-10-21 14_58_23-Library - Pipelines

When I click the blue button, I get a form with the group properties, and then a variables section below.

2020-10-21 14_59_06-Library - Pipelines

I add a couple variables and add some group info. In this case, I want some secret values that are useful across different pipelines.

2020-10-21 15_01_38-Library - Pipelines

You do need to click Save at the end of this.

In my pipeline, I see I have some variables. On the left, again, is a Variable groups item.

2020-10-21 15_02_52-Release SimpleTalkDB - Pipelines

When I click that, I don’t see any, but I haven’t linked any. Here I need to link my group.

2020-10-21 15_03_26-Release SimpleTalkDB - Pipelines

When I click this, I get a blade on the right. I can then see my group(s), and I can set a scope. I do need to click the group and then I can click link at the bottom.

2020-10-21 15_04_23-Window

Now I see the variables available in my pipeline.

2020-10-21 15_05_06-Release SimpleTalkDB - Pipelines

That’s pretty cool, especially as I am starting to see separate pipelines for different downstream environments becoming more popular.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , , . Bookmark the permalink.