问题描述
我已经建立了在Azure上一个网站,通过到位桶储存库进行部署。当它试图安装的存储私人的NuGet服务器上的NuGet包,不nuget.org进程失败。是否有指定从这样恢复的NuGet软件包的Azure可以恢复这些包的方式?
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?
推荐答案
您可以添加文件在同一水平作为你的.sln文件。
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.
如果您不需要对您的私人饲料验证,删除&LT; packageSourceCredentials方式&gt;
元素
If you do not require authentication against your private feed, remove the <packageSourceCredentials>
element.
这篇关于部署到位桶天青网站:添加私人的NuGet包服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!