如何向Azure功能提供私有NuGet提要凭据?

时间:2016-10-04 09:12:11

标签: azure nuget nuget-package azure-functions

我正在尝试创建一个Azure函数,该函数依赖于私有NuGet提要中托管的NuGet包。

This question描述了使用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).

如何提供私人Feed的凭据?

1 个答案:

答案 0 :(得分:4)

您应该可以直接在nuget配置文件中设置凭据:https://docs.nuget.org/ndocs/schema/nuget.config-file.md#packagesourcecredentials