简体   繁体   English

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

[英]Deploying to Azure Web Site using multiple package servers

I have set up a website on Azure to deploy through a TFS repository. 我已经在Azure上建立了一个网站,以通过TFS存储库进行部署。 The process fails when it tries to install nuget packages which are stored on myGet nuget server, not nuget.org. 当尝试安装存储在myGet nuget服务器而不是nuget.org上的nuget软件包时,该过程失败。 I have added(and checked into TFS) a nuget.config file in the same folder as my solution file as per this link. 我已经根据链接在与我的解决方案文件相同的文件夹中添加了nuget.config文件(并将其签入TFS)。

What am I missing so that Azure can restore these packages? 我缺少什么以便Azure可以还原这些程序包?

nuget.config: 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>

Error in TFS build: 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)

Deploying to Azure Web Site using multiple package servers 使用多个程序包服务器部署到Azure网站

Have you add a service connection to MyGet on your Azure Devops account? 您是否已在Azure Devops帐户上向MyGet添加服务连接? If not, you can try to add a service connection to MyGet. 如果没有,您可以尝试将服务连接添加到MyGet。

Then select Basic Authentication as authentication method: 然后选择基本身份验证作为身份验证方法:

在此处输入图片说明

And use that credentials when you use restore the nuget package on pipeline: 并在管道上还原nuget包时使用该凭据:

在此处输入图片说明

Check the document Visual Studio Team Services Integration for some more details. 有关更多详细信息,请参见文档Visual Studio Team Services集成

Hope this helps 希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM