【问题标题】:Deploying Bitbucket to Azure Web Site: add private nuget package server将 Bitbucket 部署到 Azure 网站:添加私有 nuget 包服务器
【发布时间】:2015-03-05 18:17:21
【问题描述】:

我在 Azure 上建立了一个网站,通过 Bitbucket 存储库进行部署。该过程在尝试安装存储在私有 nuget 服务器而不是 nuget.org 上的 nuget 包时失败。有没有办法指定从哪里恢复 nuget 包,以便 Azure 可以恢复这些包?

【问题讨论】:

    标签: asp.net-mvc azure nuget bitbucket


    【解决方案1】:

    您可以在 .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 进行部署时,这应该允许构建过程发现您的私人提要、验证和恢复您的包。

    如果您不需要针对您的私人供稿进行身份验证,请移除 &lt;packageSourceCredentials&gt; 元素。

    【讨论】:

    • 我有这个自定义文件,有一段时间了。在我的开发电脑上运行良好,但是当我通过 git(webhook 到 gitlab)部署到 azure 时,它​​似乎没有使用我的自定义存储库。完全忽略它们。我该如何解决这个问题?
    • 这仅适用于您的私有存储库可从 Azure 访问的情况。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-04
    • 2022-07-21
    • 1970-01-01
    • 1970-01-01
    • 2014-06-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多