Build failing with not being able to restore workerExtension.csproj

Ash 120 Reputation points Microsoft Employee
2024-09-19T15:37:05.55+00:00

Hi, We are encountering a transient error in our cloud build pipeline. When attempting to restore packages for our Azure Function, we receive the following errors:

D:\dbs\sh\aac6\temp\0mjoggt1.c2j\WorkerExtensions.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
D:\dbs\sh\aac6\temp\0mjoggt1.c2j\WorkerExtensions.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
D:\dbs\sh\aac6\temp\0mjoggt1.c2j\WorkerExtensions.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.js
on.

We had tried the hack as mentioned in https://github.com/Azure/azure-functions-dotnet-worker/issues/1252 to have seperate project adding the required dependencies and it had worked. However, the problem has resurfaced in the past two weeks. Could someone please assist us with this issue?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,932 questions
Developer technologies | .NET | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Pinaki Ghatak 5,600 Reputation points Microsoft Employee Volunteer Moderator
    2024-09-20T08:52:07.97+00:00

    Hello @Ash

    The error message indicates that it is unable to load the service index for the NuGet package source. This could be due to a transient network issue or a problem with the NuGet package source itself.

    One thing you could try is to clear the NuGet cache on the build agent machine to see if that resolves the issue. You can do this by running the following command: dotnet nuget locals all --clear

    If that doesn't work, you could try specifying a different NuGet package source in your project's NuGet.config file.

    I hope this helps.


  2. Ziwei Fan 0 Reputation points Microsoft Employee
    2024-12-19T17:44:26.1066667+00:00

    I faced the same error in pipline. Solved by adding a task before Nuget related tasks:

                - task: NuGetAuthenticate@0
                  displayName: 'Authenticate with NuGet feed'
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.