【问题标题】:Self Hosted Azure DevOps Pipeline Agent fails with error Token Audience is not valid自托管 Azure DevOps Pipeline Agent 失败并出现错误 Token Audience is not valid
【发布时间】:2020-06-28 20:45:06
【问题描述】:

我创建了一个具有代理池读取和管理权限的新令牌。 我创建了一个新的代理池 lnx_agent,我有管理员角色来管理它。 当我从这个链接https://vstsagentpackage-azureedge-net.o365.example-domain.defendernet.com/agent/2.171.1/vsts-agent-linux-x64-2.171.1.tar.gz 下载代理 linux x64 的 tar 文件时,将其复制到堡垒主机,解压缩并执行 ./config.sh,其中 URL、PAT 令牌、代理池为 lnx_agent 和默认代理名称为 bastion_agent;我有以下错误消息。

[2020-06-28 20:24:35Z ERR  VisualStudioServices] POST request to https://vssps-dev-azure-com.o365.example-domain.defendernet.com/Example-Client/_apis/oauth2/token failed. HTTP Status: BadRequest, AFD Ref: Ref A: C7A934103EDF47B2B3E6F148516B35B5 Ref B: DB3EDGE1015 Ref C: 2020-06-28T20:24:35Z
[2020-06-28 20:24:35Z INFO VisualStudioServices] AAD Correlation ID for this token request: Unknown
[2020-06-28 20:24:35Z INFO VisualStudioServices] Finished operation Location.GetConnectionData
[2020-06-28 20:24:35Z INFO VisualStudioServices] Finished operation Location.GetConnectionData
[2020-06-28 20:24:35Z INFO VisualStudioServices] Finished operation Location.GetConnectionData
[2020-06-28 20:24:35Z ERR  Agent] Microsoft.VisualStudio.Services.OAuth.VssOAuthTokenRequestException: The token audience is not valid https://vssps-dev-azure-com.o365.example-domain.defendernet.com/Example-Client/_apis/oauth2/token. Comparing to https://vssps-dev-azure-com.o365.example-domain.defendernet.com/Example-Client/_apis/oauth2/token; https://app-vssps-visualstudio-com.o365.example-domain.defendernet.com/Example-Client/_apis/oauth2/token.

Example-Client 是我的项目,example-domain 是我的公司名称。 这是什么意思 此令牌请求的 AAD 相关 ID:未知

由于我的 AKS 群集是私有的,因此从 Azure 发布管道连接到它的所有三个选项(如 kubeconfig、服务帐户和订阅)都失败了。因此,如果我可以在其虚拟网络与私有 AKS 集群的虚拟网络对等的堡垒主机中配置自托管代理,那么我可以通过在此堡垒主机中运行代理来成功地自动化 CD 管道。

 az devops login --organization https://dev-azure-com.o365.example-domain.defendernet.com/Example-Client
Token:
Failed to store PAT using keyring; falling back to file storage.
You can clear the stored credential by running az devops logout.
Refer https://aka.ms/azure-devops-cli-auth to know more on sign in with PAT.

【问题讨论】:

  • 你能直接从这个堡垒主机访问你的 Azure DevOps 组织吗?
  • 是的,我已经用命令 az devops login execution @AndyLi-MSFT 更新了问题
  • 您似乎无法访问 Azure DevOps 组织。您可以通过浏览器使用用户名和密码成功登录吗?我的意思是直接在浏览器中访问 ADO。
  • 我可以访问 Azure DevOps 组织。我不是免费信用帐户中的帐户所有者。但是,我也是订阅和活动目录之一的用户。
  • 能否确认您的 Azure DevOps 组织 URL?通常,URL 应该是这样的:https://dev.azure.com/{organization}https://{organization}visualstudio.com/。但根据您的描述,您的网址似乎是https://dev-azure-com.o365.example-domain.defendernet.com/Example-Client。我们从未见过这样的 Azure DevOps URL。

标签: azure azure-devops azure-aks


【解决方案1】:

首先,请确保您可以从堡垒主机访问 Azure DevOps 组织 (https://dev.azure.com/{organization})。否则我们无法连接到 Azure DevOps 服务。

其次,请检查您是否在堡垒主机上运行了防火墙或代理。如果您在防火墙后面的安全网络中运行代理,请确保代理可以使用以下文档中提到的 URL 和 IP 地址发起通信。

【讨论】:

    【解决方案2】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-15
    • 2019-10-25
    • 2022-09-25
    • 2022-11-10
    • 2021-11-21
    • 1970-01-01
    相关资源
    最近更新 更多