【问题标题】:Azure DevOps (VSTS) self-hosted Agent update URLAzure DevOps (VSTS) 自托管代理更新 URL
【发布时间】:2018-11-28 05:34:47
【问题描述】:

我正在尝试将 Azure DevOps(VSTS 代理)所需访问的 URL 列入白名单。

但是,在尝试进行自我更新时,我收到以下错误(文件为 /vsts-agent/_diag/Agent_20181127-213126-utc.log):

[2018-11-27 21:37:49Z ERR Terminal] WRITE ERROR:发生错误:响应状态码不表示成功:403(禁止)。 [2018-11-27 21:37:49Z ERR AgentProcess] System.Net.Http.HttpRequestException:响应状态码不表示成功:403(禁止)。 在 System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() 在 System.Net.Http.HttpClient.FinishGetStreamAsync(任务`1 getTask) 在 Microsoft.VisualStudio.Services.Agent.Listener.SelfUpdater.DownloadLatestAgent(CancellationToken 令牌) 在 Microsoft.VisualStudio.Services.Agent.Listener.SelfUpdater.SelfUpdate(AgentRefreshMessage updateMessage,IJobDispatcher jobDispatcher,布尔重启InteractiveAgent,CancellationToken 令牌) 在 Microsoft.VisualStudio.Services.Agent.Listener.Agent.RunAsync(AgentSettings 设置) 在 Microsoft.VisualStudio.Services.Agent.Listener.Agent.RunAsync(AgentSettings 设置) 在 Microsoft.VisualStudio.Services.Agent.Listener.Agent.RunAsync(AgentSettings 设置) 在 Microsoft.VisualStudio.Services.Agent.Listener.Agent.ExecuteCommand(CommandSettings 命令) 在 Microsoft.VisualStudio.Services.Agent.Listener.Program.MainAsync(IHostContext context, String[] args)

但是,没有列入白名单的 URL!

我找到的最接近的是:

请注意,代理已成功配置并且可以成功运行构建。只是每次更新出现时,它都会失败并且不会运行构建,直到它被删除/重新配置(不是一个选项 - 这是一个代理,不是交互式的)。

【问题讨论】:

  • 作为最后的手段,您可以在不受限制的服务器上安装托管代理并在更新期间监控流量。

标签: azure-devops azure-pipelines


【解决方案1】:

管道代理是开源的。代码可以在here找到。

浏览跟踪,我猜它在这里抛出了错误:

using (Stream result = await httpClient.GetStreamAsync(_targetPackage.DownloadUrl))

查看指定 DownloadUrl 的 assets.json,我猜这是您想要的 URL:

https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/vsts-agent-win-x64-<AGENT_VERSION>.zip

【讨论】:

    猜你喜欢
    • 2021-11-14
    • 1970-01-01
    • 2019-07-09
    • 2019-02-17
    • 2021-02-20
    • 1970-01-01
    • 2021-11-14
    • 1970-01-01
    • 2019-08-31
    相关资源
    最近更新 更多