I'm having the same issue. I put the NuGet tasks before the restore task since it failed if I didn't.
I set up authentication as Basic. It looks like I got this error when it went to get the Telerik package:
My NuGet.config and the logs are below for the restore is you could see an issue.
******************************************************************************
Starting: Use NuGet 4.3.0
******************************************************************************
==============================================================================
Task : NuGet Tool Installer
Description : Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this step to change the version of NuGet used in the NuGet steps.
Version : 0.1.5
Author : Microsoft Corporation
==============================================================================
Found tool in cache: NuGet 4.3.0 x64
Resolved from tool cache: 4.3.0
Using version: 4.3.0
Found tool in cache: NuGet 4.3.0 x64
Using tool path: C:\hostedtoolcache\windows\NuGet\4.3.0\x64
Prepending PATH environment variable with directory: C:\hostedtoolcache\windows\NuGet\4.3.0\x64
******************************************************************************
Finishing: Use NuGet 4.3.0
******************************************************************************
******************************************************************************
Starting: NuGet restore
******************************************************************************
==============================================================================
Task : NuGet
Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task.
Version : 2.0.27
Author : Microsoft Corporation
==============================================================================
C:\Windows\system32\chcp.com 65001
Active code page: 65001
Detected NuGet version 4.3.0.4406 / 4.3.0
SYSTEMVSSCONNECTION exists true
998d1992-f9ab-415f-a386-a23d9f99e4b0 exists true
Saving NuGet.config to a temporary config file.
C:\hostedtoolcache\windows\NuGet\4.3.0\x64\nuget.exe sources Remove -NonInteractive -Name Telerik -ConfigFile D:\a\1\Nuget\tempNuGet_11.config
Package source with Name: Telerik removed successfully.
C:\hostedtoolcache\windows\NuGet\4.3.0\x64\nuget.exe sources Add -NonInteractive -Name Telerik -Source https://nuget.telerik.com/nuget -ConfigFile D:\a\1\Nuget\tempNuGet_11.config -Username ******** -Password ********
Package Source with Name: Telerik added successfully.
C:\hostedtoolcache\windows\NuGet\4.3.0\x64\nuget.exe restore D:\a\1\s\PlatinumWeb.sln -Verbosity Detailed -NonInteractive -ConfigFile D:\a\1\Nuget\tempNuGet_11.config
NuGet Version: 4.3.0.4406
MSBuild auto-detection: using msbuild version '15.6.85.37198' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
MSBuild P2P timeout [ms]: 120000
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\msbuild.exe "C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\z0xeklqt.dqp.nugetinputs.targets" /t:GenerateRestoreGraphFile /nologo /nr:false /v:q /p:NuGetRestoreTargets="C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\n1r3suew.ajg.nugetrestore.targets" /p:RestoreTaskAssemblyFile="C:\hostedtoolcache\windows\NuGet\4.3.0\x64\nuget.exe" /p:RestoreSolutionDirectory="D:\a\1\s" /p:RestoreConfigFile="D:\a\1\Nuget\tempNuGet_11.config"
Running restore with 2 concurrent jobs.
Reading project file D:\a\1\s\PlatinumWeb\PlatinumWeb.csproj.
Reading project file D:\a\1\s\PlatinumWeb\PlatinumWeb.csproj.
Restoring packages for D:\a\1\s\PlatinumWeb\PlatinumWeb.csproj...
Restoring packages for D:\a\1\s\PlatinumWeb\PlatinumWeb.csproj...
Restoring packages for .NETCoreApp,Version=v2.0...
Restoring packages for .NETCoreApp,Version=v2.0...
Resolving conflicts for .NETCoreApp,Version=v2.0...
Using credentials from config. UserName: ********
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
NuGet.Protocol.Core.Types.FatalProtocolException: Failed to retrieve information about 'Telerik.UI.for.AspNet.Core' from remote source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core''. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at NuGet.Protocol.HttpSource.<>c__DisplayClass12_0`1.<<
GetAsync
>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Common.ConcurrencyUtilities.<
ExecuteWithFileLockedAsync
>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.HttpSource.<
GetAsync
>d__12`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.RemoteV2FindPackageByIdResource.<
FindPackagesByIdAsyncCore
>d__22.MoveNext()
--- End of inner exception stack trace ---
at NuGet.Protocol.RemoteV2FindPackageByIdResource.<
FindPackagesByIdAsyncCore
>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.RemoteV2FindPackageByIdResource.<
GetAllVersionsAsync
>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.SourceRepositoryDependencyProvider.<
GetAllVersionsAsync
>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.SourceRepositoryDependencyProvider.<
FindLibraryCoreAsync
>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Response status code does not indicate success: 401 (Please provide Authorization headers with your request.).
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.SourceRepositoryDependencyProvider.<>c__DisplayClass16_0.<<
FindLibraryAsync
>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.SourceRepositoryDependencyProvider.<
FindLibraryAsync
>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.ResolverUtility.<>c__DisplayClass7_1.<<
FindLibraryFromSourcesAsync
>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.ResolverUtility.<
FindLibraryFromSourcesAsync
>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.ResolverUtility.<
FindLibraryByVersionAsync
>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.ResolverUtility.<
FindLibraryMatchAsync
>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.ResolverUtility.<
FindLibraryEntryAsync
>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.RemoteDependencyWalker.<
CreateGraphNode
>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.DependencyResolver.RemoteDependencyWalker.<
CreateGraphNode
>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.ProjectRestoreCommand.<
WalkDependenciesAsync
>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.ProjectRestoreCommand.<
TryRestore
>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreCommand.<
ExecuteRestoreAsync
>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreCommand.<
ExecuteAsync
>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
ExecuteAsync
>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
ExecuteAndCommitAsync
>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
CompleteTaskAsync
>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
RunAsync
>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
RunAsync
>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.RestoreRunner.<
RunAsync
>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.RestoreCommand.<
ExecuteCommandAsync
>d__34.MoveNext()
Packages failed to restore
******************************************************************************
Finishing: NuGet restore
******************************************************************************