Azure DevOps (VSTS) link variable group through YAML

前端 未结 2 432
不知归路
不知归路 2021-01-20 01:53

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 VS

相关标签:
2条回答
  • 2021-01-20 02:04

    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

    0 讨论(0)
  • 2021-01-20 02:09

    Unfortunately we cannot link variable group through YAML for now. There is a user voice here submitted to suggest the similar feature, you can go and vote it up or submit a new one to suggest that again to achieve that in future release.

    You have to link a variable group to the YAML build pipeline from the VSTS portal. Please see Use a variable group for details.

    Another similar thread for your reference: How to access VSTS Variable Groups from YAML build pipeline?

    0 讨论(0)
提交回复
热议问题