如何向Azure Function提供私有NuGet Feed凭据?

4
我正在尝试创建一个依赖于私有NuGet feed中托管的NuGet包的Azure函数。 这个问题描述了如何使用上传到托管函数的应用程序服务的nuget.config文件 - 我的nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="MyPrivateFeed" value="https://<url to feed>" />
  </packageSources>
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
</configuration>

我的函数按照预期使用这个配置文件,但它没有所需的凭据。Azure函数门户显示如下内容:
2016-10-04T09:00:55.442 Starting NuGet restore
2016-10-04T09:00:56.926 Restoring packages for D:\home\site\wwwroot\HttpTriggerSqlDb\project.json...
2016-10-04T09:00:58.267 Please provide credentials for: https://<url to feed>
2016-10-04T09:00:58.515 Unable to load the service index for source https://<url to feed>.
2016-10-04T09:00:58.515 Response status code does not indicate success: 401 (Unauthorized).

如何为私有源提供凭据?
1个回答

4

谢谢您的回复。这个 feed 名称应该是什么?我在配置文件中没有定义它。您能详细解释一下您的答案,以便展示它应该是什么样子吗? - Vinyl Warmth
我相信在你的源代码中,"feed name" 是 "key" -- 所以在上面的例子中应该是 MyPrivateFeed - brettsam

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接