0
A
回答
0
感謝埃迪,
我找到了一個解決方案在您的幫助,我 使用0.5.8版本的VSTS任務-lib庫,並且將其更新到0.9.7,並做了以下內容,
//Import the task lib 0.9.7
import tl = require('vsts-task-lib/task');
//Get the endpoint ID (a guid)
serverEndpoint = tl.getInput('serverEndpoint', true);
//Get the enpoint URL for the retrieved end point id and parse it to URL type
serverEndpointUrl: url.Url = url.parse(tl.getEndpointUrl(this.serverEndpoint, false));
//Extract authentication details from url
serverEndpointAuth = tl.getEndpointAuthorization(this.serverEndpoint, false);
//Read parameters to variable
//NOTE: You cant write this data to console, if you do write, it will write //asterisk (****) instead of real values.
username = this.serverEndpointAuth['parameters']['username'];
password = this.serverEndpointAuth['parameters']['password'];
//Pass the variables as parameters.
1
您需要將要使用的服務端點添加到構建擴展的task.json中,然後才能在構建任務中使用它。有關詳細信息,請參閱此鏈接:Service Endpoints in Team Services。
而且您還可以查看GitHub中的VSTS Agent Task以瞭解如何在構建任務中使用服務端點,如this one。
相關問題
- 1. 從javascript訪問VSTS服務端點
- 2. 從服務器端訪問分析
- 3. 訪問從機端
- 4. Yodlee providerAccounts REST端點憑證
- 5. 如何從客戶端訪問服務器主機名知道客戶端訪問服務器FQDN
- 6. 存儲跨域Web服務訪問憑證的最佳實踐?
- 7. 從vsts/tfs訪問受身份服務器4保護的WebApi
- 8. 從VSTS版本訪問Azure服務Prinicpal詳細信息
- 9. 從WCF服務訪問客戶端證書屬性
- 10. 從服務器拒絕的powershell憑證
- 11. 從Javax-jws Web服務訪問認證
- 12. 從遠程機器訪問web服務
- 13. SQLServer服務登錄憑證
- 14. 憑證在報告服務
- 15. 從WCF測試客戶端運行WCF服務時指定客戶端憑證
- 16. 如何從服務器端後臺服務訪問Google AnalyticsAPI?
- 17. EWS:驗證服務的憑證
- 18. 如何通過'webservice憑證'傳遞給我的web服務端點?
- 19. SugarCRM賬戶憑證和機會憑證
- 20. 從憑證提供程序向C#服務提供憑證信息
- 21. Request.LogonUserIdentity.Name返回asp.net服務器憑證不是用戶憑證
- 22. 從客戶端程序訪問服務器端代碼
- 23. Azure雲服務虛擬機端點
- 24. Vsts拒絕訪問任務板
- 25. 確保客戶端/服務器身份驗證沒有憑據
- 26. 在Azure函數中訪問VSTS構建服務器版本
- 27. 跨機隊的憑證分配/存儲
- 28. 使用ASP.NET Core後端服務器驗證Google訪問令牌
- 29. 驗證Facebook用戶ID和訪問令牌服務器端
- 30. 從本地主機以外的機器訪問WCF服務
什麼是您的擴展的類型,構建任務? –
是它的構建擴展。 – Bandara