top of page
Writer's picturemicah jardine

Using Azure DevOps Variable Libraries

Azure DevOps contains a feature called Variable Libraries.

Variable Libraries allow you to share a set of variables across multiple pipelines. This can save a lot of time and improve consistency, and reduce errors.


My templates require me to enter a set of values, such as Company, Department for each template. Rather than define a variable in every pipeline for these values, you can define the variables in a Variable Library and then link that library to a pipeline. You can link multiple libraries to a template allowing you to create a hierarchy of libraries.


As an example I have a variable library of standard variables that I use when deploying Azure infrastructure, that includes:


Image displaying variable group

You can also have another variable library that contains variables that relate to a particular application. You can also create secrets in the library by clicking padlock icon on a variable.


Image displaying a second variable library

From Pipelines you can then link to these libraries so the pipeline can make use of the centrally defined variables.


Image displaying a release pipeline with linked variable libraries

You can also link from a yaml pipeline using

variables:
    - group: MicahStandardVariables
    - group: Application-OdeToFood-Variables

You can also link variable libraries to Azure KeyVault, and add security to them to limit a libraries use by authorised users and groups.


Documentation




1,056 views0 comments

Recent Posts

See All

Simple RBAC Model for Azure & DevOps

Azure RBAC models in Enterprises do not need not be complex. Microsoft recommends having fewer subscriptions and creating granular permissio

©2020 by Micah Jardine - Azure Cloud Blog. Proudly created with Wix.com

bottom of page