4

I am trying to create an Azure function which has dependencies on NuGet packages hosted in a private NuGet feed.

This question describes using a nuget.config file which is uploaded to the app service which hosts the function - my 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>

My function is using this config file as expected, but it doesn't have the credentials it needs. The Azure function portal shows the following:

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).

How do I provide credentials for the private feed?

Vinyl Warmth
  • 2,226
  • 3
  • 25
  • 50

1 Answers1

4

You should be able to set up your credentials directly in the nuget config file: https://docs.nuget.org/ndocs/schema/nuget.config-file.md#packagesourcecredentials.

brettsam
  • 2,702
  • 1
  • 15
  • 24
  • Thanks for your reply. What should the feed name be? I don't have it defined in the config file. Could you elaborate your answer to show how it should look? – Vinyl Warmth Oct 04 '16 at 19:32
  • I believe the feed name is the 'key' in your source -- so above it would be `MyPrivateFeed`. – brettsam Oct 04 '16 at 19:33