我正在使用 VSTS 的 REST API 来启动特定环境的发布。检索环境和此类工作,但是,当我进行 REST 调用以实际开始部署时,我收到以下错误消息:
[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
有趣的是来自 REST 操作的响应以检索具有其环境的发布定义,返回如下:
...
"id": 16,
"name": "Environment 2",
"rank": 2,
...
事实上,在整个响应中,我在任何地方都找不到 ID 1288 和 1289。关于为什么 VSTS 告诉我我的环境 ID 为 16 是错误的任何想法,即使这是从他们的服务返回的内容?