TFS 2017-构建期间的NuGet Publisher步骤因401未经授权而失败 [英] TFS 2017 - NuGet Publisher step during a build fails with 401 Unauthorized

查看:131
本文介绍了TFS 2017-构建期间的NuGet Publisher步骤因401未经授权而失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个构建定义,其中包括将NuGet程序包打包并发布到内部提要的步骤。该内部提要位于同一台TFS服务器上。

I have a build definition that includes steps to package and publish a NuGet package to an internal feed. That internal feed resides on the same TFS server.


  • 这是在Prem上

  • TFS 2017 15.105 .25910.0

  • 提要的权限为:

  • 所有者:


    • [我的帐户]

    • [集合] \项目集合管理员

    • This is on prem
    • TFS 2017 15.105.25910.0
    • Permissions for the feed are:
    • OWNERS:
      • [My account]
      • [Collection]\Project Collection Administrators

      • 项目集合构建服务(团队基金会)


      • [Collection] \项目集合有效用户

      NuGet程序包工作正常,但NuGet发布步骤失败,并出现以下错误:

      The NuGet package step works fine, but the NuGet publish step fails with the following error:

      Unable to load the service index for source https://[server]/[collection]/_packaging/Feed/nuget/v3/index.json. 
      Response status code does not indicate success: 401 (Unauthorized).
      

      我在构建定义的开头放了一个Powershell脚本,以确定在构建过程中使用的确切帐户流程,并指示项目集合构建服务(TEAM FOUNDATION),该项目具有对Feed进行贡献的权限。

      I put in a Powershell script early in the build definition to determine the exact account being used during the build process, and it indicated Project Collection Build Service (TEAM FOUNDATION), which has permission to contribute to the feed.

      以下是其中的内容Nuget.Config文件位于 C:fileWindows\ServiceProfiles\NetworkService\AppData\Roaming\NuGet>

      Here are the contents of the Nuget.Config file at C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\NuGet>

      <?xml version="1.0" encoding="utf-8"?>
      <configuration>
        <disabledPackageSources>
          <add key="Microsoft Visual Studio Offline Packages" value="true" />
        </disabledPackageSources>
        <packageSources>
          <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
        </packageSources>
      </configuration>
      

      还有哪些其他信息可以帮助我诊断问题?

      What other information would be useful to help me diagnose with issue?

      推荐答案

      检查TFS服务器中默认的访问级别是否设置为 利益相关者

      Check if the default access level was set to "Stakeholder" in your TFS server.

      p>

      如果是这样,请手动将 TFS服务帐户/项目集合生成服务明确添加到高级组,然后尝试运行再次构建。有关更多详细信息,请参阅以下类似问题: TFS 2017 NuGet发布者任务失败,并显示401-未经授权的异常

      If so, manually add the TFS Service account/ Project Collection Build Service explicitly to the Advanced group and try to run the build again. For more details please refer this similar issue: TFS 2017 NuGet publisher task fails with 401 - Unauthorized exception

      这篇关于TFS 2017-构建期间的NuGet Publisher步骤因401未经授权而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆