使用多个程序包服务器部署到Azure网站

时间:2019-06-06 12:17:03

标签: azure asp.net-core azure-devops nuget myget

我已经在Azure上建立了一个网站,以通过TFS存储库进行部署。当尝试安装存储在myGet nuget服务器而不是nuget.org上的nuget软件包时,该过程失败。我已根据this链接在与我的解决方案文件相同的文件夹中添加了nuget.config文件(并将其签入TFS)。

我缺少什么以便Azure可以还原这些软件包?

nuget.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <activePackageSource>
  <add key="All" value="(Aggregate source)" />
</activePackageSource>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="Syncfusion ASP.NET Core NuGet Package feed URL" value="http://nuget.syncfusion.com/nuget_aspnetcore/nuget/getsyncfusionpackages/aspnetcore" />
    <add key="MyGet" value="https://www.myget.org/F/aspnet-contrib/api/v3/index.json" />
  </packageSources>
<disabledPackageSources />
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
  <packageManagement>
    <add key="format" value="0" />
    <add key="disabled" value="False" />
  </packageManagement>
</configuration>

TFS构建错误:

 NuGet Config files used:
             D:\a\3\Nuget\tempNuGet_59.config

         Feeds used:
             https://api.nuget.org/v3/index.json

         Installed:
             100 package(s) to D:\a\3\s\Scrubber\Scrubber.csproj
             132 package(s) to D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj
             9 package(s) to D:\a\3\s\SimplerProducts.MicrosoftEntityFrameworkCoreStorage\SimplerProducts.MicrosoftEntityFrameworkCoreStorage.csproj
       Done executing task "RestoreTask" -- FAILED.
     1>Done building target "Restore" in project "Scrubber.UnitTest.csproj" -- FAILED.
     1>Done Building Project "D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj" (Restore target(s)) -- FAILED.

Build FAILED.

       "D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj" (Restore target) (1) ->
       (Restore target) -> 
         D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Instagram with version (>= 2.1.0) [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
       D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102:   - Found 11 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
         D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Reddit with version (>= 2.1.0) [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
       D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102:   - Found 13 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
         D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.GitHub with version (>= 2.1.0) [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
       D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102:   - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
         D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.LinkedIn with version (>= 2.1.0) [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
       D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102:   - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
         D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Instagram with version (>= 2.1.0)
       D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102:   - Found 11 version(s) in nuget.org [ Nearest version: 2.0.1 ]
         D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Reddit with version (>= 2.1.0)
       D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102:   - Found 13 version(s) in nuget.org [ Nearest version: 2.0.1 ]
         D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.GitHub with version (>= 2.1.0)
       D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102:   - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ]
         D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.LinkedIn with version (>= 2.1.0)
       D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102:   - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ]

    0 Warning(s)
    8 Error(s)

1 个答案:

答案 0 :(得分:1)

  

使用多个程序包服务器部署到Azure网站

是否已在Azure Devops帐户上向MyGet添加服务连接?如果没有,您可以尝试将服务连接添加到MyGet。

然后选择基本身份验证作为身份验证方法:

enter image description here

并在还原管道上的nuget包时使用该凭据:

enter image description here

查看文档Visual Studio Team Services Integration,了解更多详细信息。

希望这会有所帮助