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

前端 未结 1 1171
傲寒
傲寒 2020-12-31 13:01

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 serv

相关标签:
1条回答
  • 2020-12-31 13:46

    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.

    0 讨论(0)
提交回复
热议问题