且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法向 Azure Function 提供 NuGet 包源凭据

更新时间:2022-03-04 22:19:11

尝试使用 key=ClearTextPassword"(而不是 key=Password").如果您使用 Password,NuGet 会假定该值已加密并会尝试对其进行解密.

Try using key="ClearTextPassword" (instead of key="Password"). If you use Password, NuGet assumes the value is encrypted and will try to decrypt it.

例如,我在 VSTS 中创建了一个包提要,然后创建了一个个人访问令牌并使用了这个:

For example, I created a package feed in VSTS, then created a personal access token and used this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="MyPrivateFeed" value="https://brettsam.pkgs.visualstudio.com/_packaging/***/nuget/v3/index.json" />
  </packageSources>
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
  <packageSourceCredentials>
    <MyPrivateFeed>
      <add key="Username" value="brettsam" />
      <add key="ClearTextPassword" value="{PAT}" />
    </MyPrivateFeed>
  </packageSourceCredentials>
</configuration>