Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure DevOps (VSTS) link variable group through YAML

When using YAML for builds, I could not find how to give an instruction that refers to the variable group I want to use. I had to manually open my build definition in the VSTS builds UI and create the link.

Does anyone know how to refer the variable group through the YAML?

like image 750
Cassio Avatar asked Sep 17 '18 16:09

Cassio


1 Answers

This is now supported in YAML Schema.

Microsoft Variable Group Documentation

For quick reference, from their documentation the usage looks like:

variables:
- group: my-variable-group
- name: my-bare-variable
  value: 'value of my-bare-variable'

I came across this when looking for support for setting the variable group name dynamically such as: -group: connectioninfo-$(env) but this is currently not supported. The issue on this is located here in case this enhancement to variables groups is of interest to you in the future as well.

https://github.com/MicrosoftDocs/vsts-docs/issues/3702

like image 116
sheldonhull Avatar answered Dec 08 '22 06:12

sheldonhull