Azure DevOps OnPrem - 服务连接失败 - 无法获取 Json Web token

标签 azure azure-devops azure-devops-server-2019 serviceconnection

所以,有点奇怪,我希望有人遇到这个问题并找到解决方案(或者理解为什么会发生)

所以这曾经毫无问题地工作......据我们所知,这周才开始发生

基本上,当您在 Azure DevOps 中创建新的 Azure 资源管理器服务连接时,您会收到以下错误; 无法使用服务主体客户端 ID 获取 Json Web token (JWT)。异常消息:对象引用未设置到对象的实例。

这只发生在我们的本地 Azure DevOps 服务器上 - 我可以在 Dev.Azure.com 版本上使用相同的设置创建服务连接,不会出现任何问题。

疑难解答

  • 创建了多个服务主体
  • 尝试了不同的订阅
  • 尝试向 SP 所有者授予订阅权限
  • 即使您尝试重新验证现有服务连接,也会收到相同的错误
  • 在 Dev.Azure.com 中工作
  • 我们的本地内容没有发生任何网络变化
  • 仍然能够使用现有服务连接执行发布操作(即使您无法验证它们)
  • 尝试按照 MS 故障排除页面的建议创建另一个 secret
  • 我有一个 PS 脚本,可以使用我创建且有效的 SP 来获取不记名 token

显然,我已经尝试用谷歌搜索这个问题,它出现在几个地方,但没有一个解决方案或理解为什么会发生......

TIA

最佳答案

可以在“故障排除”页面上找到解决方案,可通过服务连接的“编辑” Pane 中的“故障排除”链接访问:Troubleshoot ARM service connections

相关部分粘贴在此处以供引用/保留:

Failed to obtain the JWT by using the service principal client ID

This issue occurs when you try to verify a service connection that has an expired secret.

To resolve this issue:

  1. Go to Project settings > Service connections, and then select the service connection you want to modify.

  2. Select Edit in the upper-right corner, and then make any change to your service connection. The easiest and recommended change is to add a description.

  3. Select Save to save the service connection.

⚠ Note

Select Save. Don't try to verify the service connection at this step.

  • 退出服务连接编辑窗口,然后刷新服务连接页面。

  • 选择右上角的编辑,然后选择验证

  • 选择保存以保存您的服务连接。

  • 关于Azure DevOps OnPrem - 服务连接失败 - 无法获取 Json Web token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66171936/

    相关文章:

    c# - 我想使用授权级别来保护 azure 功能

    Azure DevOps Pipeline Azure Blob 存储上传文件 403 禁止异常

    sql-server - 如何将集合从 TFS 2017 迁移到 Azure DevOps Server 2019(不同的数据库服务器)

    azure - 无法在 DevOps Server 中构建 VB6 应用程序

    ios - Visual Studio 需要凭据才能在 Mac 上访问 pkgs.dev.azure.com

    azure-devops - 如何在 Azure DevOps 2020 中手动更新 Build Agent?

    c# - 从 ASP.Net Web 应用程序在 Azure 虚拟机中远程运行 .exe

    azure - 在线构建服务器TFS

    azure - 如何访问/将模块输出转换到二头肌中的特定对象?

    azure-devops - 如何调整 VSTS 仪表板小部件的大小