azure-devops - Azure DevOps (VSTS) 自托管代理更新 URL

标签 azure-devops azure-pipelines

我正在尝试将 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/

相关文章:

azure-devops - 自动生成 Key Vault Secrets

Azure 容器应用程序无法从不同订阅中存在的 Azure 容器注册表中提取镜像

git - 使用 Git 触发 CI Build 仅对 VSTS 中的子文件夹进行更改(以前是 TFS Online)

azure - 如何使用 GitHub Branch 作为 Azure DevOps Pipelines 的参数?

git - 设置 fork 仓库的 pull 请求默认分支

azure - 相当于发布管道的 YAML 是什么?

azure - Azure Pipelines 的并行化

azure-devops - 从外部源填充运行时 azure 管道参数

powershell - 从 VS Team Services 构建中运行的 Powershell 创建工作区

azure - 路径 "/home/vsts/work/1/s/javapipetest13/Orchestration/dev/deployment.yaml"不存在