Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS Rest API - Create Release

I'd like to start a release leveraging the VSTS Rest API defined here: https://www.visualstudio.com/en-us/docs/integrate/api/rm/releases#create-a-release

but I need to set some of the variable values when I create the release. Looking at the ReleaseMetadata (https://www.visualstudio.com/en-us/docs/integrate/api/rm/contracts#ReleaseStartMetadata) I see there is a properties collection. Is this where I'd set the variable values? Is there any special naming convention I need to use in the property name to translate it the variable name? (like ##VSTS:[])??

like image 773
cdarrigo Avatar asked Mar 06 '23 16:03

cdarrigo


1 Answers

Now you can define VSTS Release variables to be "Settable at release time" as shown below. enter image description here

Then you can use below json syntax in VSTS REST API call request body to pass the variable values to set at the time of creating the release.

"variables": {
    "Variable1Name": {
      "value": "Variable1Value"
    },
    "Variable2Name": {
      "value": "Variable2Value"
    }
  }

enter image description here

For more information refer the post here.

like image 170
ChamindaC Avatar answered Mar 15 '23 14:03

ChamindaC