Access Nuget Packages hosted in private Nuget serv

2019-01-23 05:32发布

问题:

How can I access nuget packages hosted in private nuget server in Azure Functions?. Is there any way I can specify my private nuget server info?

Thanks!

回答1:

Krishh,

This is possible using a nuget.config file as you normally would:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="MyPrivateFeed" value="http://myhost/myfeed" />
    ... other feeds ...
  </packageSources>
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
</configuration>

Using Kudu, or another deployment method outlined here, copy that file to either the function folder or wwwroot (that would apply to all functions) and your config will be used.



回答2:

There are several posts related to your question if we assume that your private nuget package can be deployed as a simple .Net library:

  • Execute pre-compiled .NET code as Azure Function
  • How do you include references to external assemblies in Azure Functions
  • How do I use external assemblies with Microsoft Azure Function Apps?
  • How to put the entry point of an Azure Function inside a .NET DLL?