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. 從服務器端訪問分析
- 2. Google端點:從本機客戶端訪問認證api
- 3. 訪問從機端
- 4. Yodlee providerAccounts REST端點憑證
- 5. 服務器端從視覺點驗證
- 6. 如何從客戶端訪問服務器主機名知道客戶端訪問服務器FQDN
- 7. 從vsts/tfs訪問受身份服務器4保護的WebApi
- 8. 從VSTS版本訪問Azure服務Prinicpal詳細信息
- 9. 使用服務帳戶憑證訪問Google課堂API
- 10. 存儲跨域Web服務訪問憑證的最佳實踐?
- 11. 從openshift服務器訪問端口7000
- 12. 從客戶端發送登錄憑證到OData服務
- 13. 編碼到WCF服務而無需從開發機器訪問端點
- 14. 從WCF服務訪問客戶端證書屬性
- 15. 從遠程服務器端訪問本地主機
- 16. 從服務器拒絕的powershell憑證
- 17. 從Javax-jws Web服務訪問認證
- 18. 從Android手機訪問網絡服務
- 19. 從遠程機器訪問web服務
- 20. QsslSocket:不能對其他同行訪問端點(客戶端)證書(服務器)
- 21. 從本地無法訪問WCF服務端點
- 22. 憑證在報告服務
- 23. SQLServer服務登錄憑證
- 24. 服務器應用程序獲得用戶憑證和使用這些憑據訪問網絡服務
- 25. 如何從服務器端後臺服務訪問Google AnalyticsAPI?
- 26. 從web服務客戶端訪問java web服務
- 27. 從.net客戶端訪問ssl服務器(web服務)
- 28. 從WCF測試客戶端運行WCF服務時指定客戶端憑證
- 29. 爲數據庫訪問保證憑證
- 30. EWS:驗證服務的憑證
什麼是您的擴展的類型,構建任務? –
是它的構建擴展。 – Bandara