Grouping Shared Variables in Azure DevOps Pipeline helps to organize and managing common variables across different Build and Release Pipelines. When you have multiple sets of pipelines; and many of them use common variables; instead of having variable defined for each pipeline we can leverage the feature of grouping variables
Grouping Shared Variables in Azure DevOps
We can create the Variable Groups from Pipelines – Library and then select + Variable Group.
While Creating the variable group, you can choose the options to Link it with Azure KeyValuts as well as you will have an option to share the variable groups across Pipeline.
Sharing it with accross pipeline is Key as it allows same set of variables to be used across different build or release pieline.
Once the Variable group is Created, from the Release Pipelline, you can Link the Variable Group.
Go to the Build / Release Definition, Move to Variables Tabs, and then select “Variable Groups.” Under Variable Groups, you will have the option to “Link Variable Group” that will list all the Variable groups created under the Library.
Variable Group can be clone very easily also you can have Team specific security access for the groups.
Overall, Azure DevOps Variable Group manages a different set of variables efficiently in a single place. This can help to share variables across pipelines as well as manage and update them quickly.