Closed willbush closed 7 years ago
I couldn't figure out how to do it through the C# API, but it can be done with an http request:
https://www.visualstudio.com/en-us/docs/integrate/api/rm/definitions
GET https://{instance}/{project}/_apis/release/definitions/{definitionId}?api-version={version}
What this documentation doesn't point out is that this is available only with version=3.0-preview
This will return environments expanded and everything in those environments including environmental variables.
You should get a single release definition instead of querying for N definitions and that will give you all the variables. The method name should be something like GetReleaseDefinitionAsync(...)
Thanks for the response. Feel free to close the issue. I did not test what you suggested, but it sounds like it will work. I ended up just parsing the json to get the data I wanted and it was pretty easy to do.
Closing the issue as per customer comment.
I can get release release definitions with their environments expanded, but those environments don't have their variables expanded.
One would hope this would work:
However, it throws an exception because the task group ID was not found (an optional param). I am having trouble locating this ID in TFS, and I cannot find any documentation on the GetDefinitionEnvironmentsAsync method.