Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Bitbucket to Azure Web Site: add private nuget package server

I have set up a website on Azure to deploy through a Bitbucket repository. The process fails when it tries to install nuget packages which are stored on a private nuget server, not nuget.org. Is there a way to specify where to restore the nuget packages from so that Azure can restore these packages?

like image 387
Jake Avatar asked Mar 05 '15 18:03

Jake


1 Answers

You can add a custom NuGet.config file at the same level as your .SLN file.

You can then make the following modifications (assuming that your private feed requires authentication, create a set of credentials which only are used for this site):

<activePackageSource>
  <add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSources>
  <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
  <add key="custom_package_source" value="https://custom_package_source/nuget/v1/FeedService.svc/" />
</packageSources>
<disabledPackageSources />
<packageSourceCredentials>
  <custom_package_source>
    <add key="Username" value="CustomUsername" />
    <add key="ClearTextPassword" value="CustomPassword" />
  </custom_package_source>
</packageSourceCredentials>

When you deploy via Kudu, this should allow the build process to discover your private feed, authenticate & restore your packages.

If you do not require authentication against your private feed, remove the <packageSourceCredentials> element.

like image 52
HowardvanRooijen Avatar answered Sep 30 '22 13:09

HowardvanRooijen