I'm using the REST API for VSTS to kick off a release for a specific environment. Retrieving the environment and such works, however, when I make the REST call to actually start the deployment, I get the following error message:
[DBG]: PS C:\Users\mmulhe200>>
executeRequest : {"$id":"1","innerException":null,"message":"Environment with ID '16' is not valid. Valid environments have IDs
'1288,1289'. Specify a valid environment and try
again.","typeName":"Microsoft.VisualStudio.Services.ReleaseManagement.Data.Exceptions.InvalidRequestException,
Microsoft.VisualStudio.Services.ReleaseManagement2.Data","typeKey":"InvalidRequestException","errorCode":0,"eventId":3000}
At C:\Users\mmulhe200\Desktop\VSTS release task\test\Untitled1.ps1:58 char:12
+ return executeRequest $request;
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,executeRequest
What's interesting about that is the response from the REST operation to retrieve a release definition with its environments returns such:
...
"id": 16,
"name": "Environment 2",
"rank": 2,
...
In fact, in the entire response, I can't find the ID 1288 nor 1289 anywhere. Any thoughts on why VSTS is telling me my environment ID of 16 is wrong even though it's what's returned from their service?
