2016-10-04 52 views
4

我正在使用VSTS的REST API啓動特定環境的發佈。檢索環境和這樣的作品,但是,當我做REST調用真正開始部署,我收到以下錯誤信息:VSTS Rest API環境ID不正確

[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 1288和1289。任何關於爲什麼VSTS告訴我我的環境ID是16是錯誤的,即使它是從他們的服務中返回的東西?

回答

0

這是查看頁面上環境ID的方式。將它顯示在工具提示或頁面上會很棒。這是它需要的。

第1步打開Chrome檢查工具

步驟2單擊環境

第3步獲取相關ID

enter image description here