Reputation: 878
I know i can link my variable group stored in Library into a Release Definition, but my build definition doesn't have an option to link the variable group. I see it is available in TFS 2018. We are not upgrading our Prod instance from TFS 2017 anytime sooner. Is there any out of box method/way that i can link and read the library group?
Upvotes: 0
Views: 386
Reputation: 878
I was able to get TFS 2017 variable groups in JSON format. I'm now loading the JSON and instantiate the library groups.
http://tfsinstance/collectionname/teamproject/_apis/distributedtask/variablegroups/
Idea is to encapsulate this as a custom task and fetch required variable groups in the build definitions.
Upvotes: 1
Reputation: 76670
Is there any out of box method/way that i can link and read the library group?
Sorry for any inconvenience.
I am afraid there is no such out-of-the-box method to link variable group in TFS 2017 Build definition.
There were many user voices about it before, and this request is resolved at Team Foundation Server 2018, MS team has no plans to apply it to TFS2017:
Variable group support
Variable groups have been available to use in release definitions, and now they are ready to be used in build definitions, too. Learn more about creating a variable group. This has been developed and prioritized based on related suggestions for project-level build/release variables and variable groups in build definitions.
And, AFAIK, there is currently no better workaround to solve this issue for TFS 2017.
So, we have to repeatedly define variables for each build pipeline before updating our TFS to 2018.
Hope this helps.
Upvotes: 1