使用Azure AD工作帐户访问Azure DevOps程序包提要 [英] Accessing Azure DevOps package feed with Azure AD Work Account

查看:125
本文介绍了使用Azure AD工作帐户访问Azure DevOps程序包提要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Azure DevOps中有一个私人feed,我是该feed的所有者,为了访问Azure DevOps,我使用了我的工作帐户.

I have a private feed in Azure DevOps, I am the owner of the feed and in order to access Azure DevOps I use my work account.

从软件包管理控制台访问提要时,将显示一个弹出窗口以输入我的凭据,但是输入工作帐户凭据将返回401提要.如果我尝试再次在浏览器中访问提要,它会提示我输入我的凭据,但是我最终陷入循环,要求输入我的凭据.

When accessing the feed from package manage console a pop up is displayed to enter my credentials, but entering the work account credentials returns a 401 feed. If I try to access the feed in the browser again it prompts me to enter my credentials but I just end up in a loop asking for my credentials.

按照这里的说明,我设法使nuget cli正常工作:

I've managed to get nuget cli working after following the instructions here:

https://docs .microsoft.com/en-us/azure/devops/artifacts/nuget/bootstrap-nuget?view = vsts

但是,Visual Studio软件包管理器控制台似乎不想使用CredentialProvider.VSS.exe,因此给了我弹出窗口.

However Visual Studio Package Manager console doesn't seem to want to use the CredentialProvider.VSS.exe and so is giving me the popup.

1)我在哪里可以找到为什么它会给我401?我是供稿的所有者,并且供供组织中的人员使用的供稿?

1) Where would I look for why it is giving me a 401? I'm the owner of the feed and feed is set to be accessible to people in my organisation?

2)上面的链接文章指出开发人员凭据未放置在存储库的nuget.config中.当init运行时,它将凭据放置在用户的NuAPP配置中的%APPDATA%下".但是,看着它并没有在该文件中放置任何凭据

2) The linked artice above states "Developer credentials are not placed in the repo's nuget.config. When init runs, it places credentials in the user's NuGet config under %APPDATA%". However looking at this and it has not placed any credentials in that file

有时使用Package Manager控制台时,我得到以下信息:

Sometimes when using Package Manager console I get the following:

找不到VSO帐户的有效凭据

No valid credentials found for VSO account

任何指针都非常感谢.

推荐答案

使用Azure AD工作帐户访问Azure DevOps程序包提要

Accessing Azure DevOps package feed with Azure AD Work Account

当我第一次在Visual Studio中配置Azure DevOps程序包提要时,我收到了与您相同的401错误消息.原因是您所说的Visual Studio程序包管理器控制台未使用CredentialProvider.VSS.exe.因此,要解决此问题,我们需要使用nuget.config文件手动为Visual Studio提供凭据:

When I first configured the Azure DevOps package feed in Visual Studio, I got the same 401 error message as you. The reason is as you said Visual Studio Package Manager console not use the CredentialProvider.VSS.exe. So, to resolve this issue, we need to provide credentials to Visual Studio manually with nuget.config file:

nuget.config中添加以下内容:

  <packageSources>
    <add key="AzureDevOpsFeed" value="<ThePackageSourceFeedUrl>/MyCustomFeed/nuget/v3/index.json" />
  </packageSources>


  <packageSourceCredentials>
    <AzureDevOpsFeed>
      <add key="Username" value="<YourUserName>" />
      <add key="ClearTextPassword" value="<YourPassword>" />
    </AzureDevOpsFeed>
  </packageSourceCredentials>

之后,我们可以在Visual Studio中使用Azure DevOps包供稿.而且,如果要将此软件包提要与构建定义上的nuget restore任务一起使用,则可以选择选项Feed in my nuget.config:

After that, we could use Azure DevOps package feed in Visual Studio. And if you want to use this package feed with nuget restore task on build definition, you can select the option Feed in my nuget.config:

希望这会有所帮助.

这篇关于使用Azure AD工作帐户访问Azure DevOps程序包提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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