I am using the REST API for VSTS to start a release for a specific environment. However, getting the environment and such work, when I make a REST call to 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
Interestingly, the response from the REST operation to get the release definition with its environments returns:
...
"id": 16,
"name": "Environment 2",
"rank": 2,
...
In fact, in the whole answer I cannot find ID 1288 or 1289 anywhere. Any thoughts on why VSTS tells me that my environment identifier 16 is wrong, even if it returned from their service?
source
share