![](/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.