2

I am running a Azure DevOps pipeline, and I get the following error.

error: Unable to load the service index for source https://pkgs.dev.azure.com/companyName/_packaging/12345678-1234-1234-1234-1234567890ab/nuget/v3/index.json.
error:   Response status code does not indicate success: 403 (Forbidden - User '12345678-1234-1234-1234-1234567890ab' lacks permission to complete this action. You need to have 'ReadPackages'. (DevOps Activity ID: 12345678-1234-1234-1234-1234567890ab)).

And I am getting the error from a task whose yaml looks like this.

steps:
- task: DotNetCoreCLI@2
  displayName: 'Push the created package to Nuget feed. '
  inputs:
    command: push
    publishVstsFeed: '12345678-1234-1234-1234-1234567890ab'
    versioningScheme: byPrereleaseNumber

Any ideas what to be done?

VivekDev
  • 20,868
  • 27
  • 132
  • 202

1 Answers1

6

Azure DevOps - Unable to load the service index for source

It seems you have not authenticated your private feed, please try to add the task NuGetAuthenticate

- task: NuGetAuthenticate@0
  displayName: 'NuGet Authenticate'
  inputs:
    nuGetServiceConnections: TestNuGet

And create a service connection for the private feed:

enter image description here

Leo Liu
  • 71,098
  • 10
  • 114
  • 135