Shiju Samuel
Shiju Samuel

Reputation: 1591

VSTS Release Definition Variables

Is there a way to access environment variables in Visual Studio Team Services through REST API? I have a couple of environments defined with around 50+ variables and during the development phase team adds one or more variables and it becomes hard to spot added variables and propagate it in other environments. The UI is also not very intuitive it shows one table which cannot even be exported to compare.

enter image description here

Upvotes: 1

Views: 692

Answers (2)

Marina Liu
Marina Liu

Reputation: 38096

Yes, you can use REST API to access your release environment variables:

GET https://account.vsrm.visualstudio.com/DefaultCollection/project/_apis/release/definitions/definitionID?$expand=environments&api-version=3.0-preview.1

Then you will get variables for different environments, and compare variables or their values as you want.

Note: you should add vsrm after your account.

Upvotes: 1

Harshil Lodhi
Harshil Lodhi

Reputation: 7762

If you go to the variables tab at the release definition, there is a filter at the top right of the editor which will allow you to easily compare variables across environments.

You can export the whole release definition by clicking on the three dots in the left pane which shows list of release definitions and then compare variables in JSON.

enter image description here

Upvotes: 1

Related Questions