![](/img/trans.png)
[英]Can't provide NuGet package source credentials to Azure Function
[英]How do I provide private NuGet feed credentials to an Azure Function?
我正在尝试创建一个Azure函数,该函数依赖于私有NuGet提要中托管的NuGet包。
这个问题描述了使用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的凭据?
您应该可以直接在nuget配置文件中设置凭据: https ://docs.nuget.org/ndocs/schema/nuget.config-file.md#packagesourcecredentials。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.