Access Nuget Packages hosted in private Nuget server in Azure Functions

后端 未结 2 1045
终归单人心
终归单人心 2020-12-14 21:33

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!

相关标签:
2条回答
  • 2020-12-14 22:03

    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.

    0 讨论(0)
  • 2020-12-14 22:20

    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?
    0 讨论(0)
提交回复
热议问题