我正在尝试将 Azure DevOps(VSTS 代理)所需的访问 URL 列入白名单。
但是,当尝试进行 self 更新时,我收到以下错误(文件为/vsts-agent/_diag/Agent_20181127-213126-utc.log):
[2018-11-27 21:37:49Z ERR Terminal] WRITE ERROR: An error occurred: Response status code does not indicate success: 403 (Forbidden). [2018-11-27 21:37:49Z ERR AgentProcess] System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 (Forbidden). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at System.Net.Http.HttpClient.FinishGetStreamAsync(Task`1 getTask) at Microsoft.VisualStudio.Services.Agent.Listener.SelfUpdater.DownloadLatestAgent(CancellationToken token) at Microsoft.VisualStudio.Services.Agent.Listener.SelfUpdater.SelfUpdate(AgentRefreshMessage updateMessage, IJobDispatcher jobDispatcher, Boolean restartInteractiveAgent, CancellationToken token) at Microsoft.VisualStudio.Services.Agent.Listener.Agent.RunAsync(AgentSettings settings) at Microsoft.VisualStudio.Services.Agent.Listener.Agent.RunAsync(AgentSettings settings) at Microsoft.VisualStudio.Services.Agent.Listener.Agent.RunAsync(AgentSettings settings) at Microsoft.VisualStudio.Services.Agent.Listener.Agent.ExecuteCommand(CommandSettings command) at Microsoft.VisualStudio.Services.Agent.Listener.Program.MainAsync(IHostContext context, String[] args)
但是,没有将 URL 列入白名单!
我发现的最接近的是:
请注意,代理已成功配置并且可以成功运行构建。只是每次更新出现时,它都会失败并且不会运行构建,直到它被删除/重新配置(不是一个选项 - 这是一个代理,而不是交互式)。
最佳答案
管道代理是开源的。代码可以找到here 。
浏览一下跟踪,我猜它会在这里抛出错误:
using (Stream result = await httpClient.GetStreamAsync(_targetPackage.DownloadUrl))
浏览 assets.json指定 DownloadUrl,我猜这就是您想要的 URL:
https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/vsts-agent-win-x64-<AGENT_VERSION>.zip
关于azure-devops - Azure DevOps (VSTS) 自托管代理更新 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53512760/