【发布时间】:2015-03-05 18:17:21
【问题描述】:
我在 Azure 上建立了一个网站,通过 Bitbucket 存储库进行部署。该过程在尝试安装存储在私有 nuget 服务器而不是 nuget.org 上的 nuget 包时失败。有没有办法指定从哪里恢复 nuget 包,以便 Azure 可以恢复这些包?
【问题讨论】:
标签: asp.net-mvc azure nuget bitbucket
我在 Azure 上建立了一个网站,通过 Bitbucket 存储库进行部署。该过程在尝试安装存储在私有 nuget 服务器而不是 nuget.org 上的 nuget 包时失败。有没有办法指定从哪里恢复 nuget 包,以便 Azure 可以恢复这些包?
【问题讨论】:
标签: asp.net-mvc azure nuget bitbucket
您可以在 .SLN 文件的同一级别添加一个custom NuGet.config 文件。
然后您可以进行以下修改(假设您的私人提要需要身份验证,创建一组仅用于此站点的凭据):
<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>
当您通过 Kudu 进行部署时,这应该允许构建过程发现您的私人提要、验证和恢复您的包。
如果您不需要针对您的私人供稿进行身份验证,请移除 <packageSourceCredentials> 元素。
【讨论】: