Running pipeline in AzureDevops gets 401 Unauthorized error

310 Views Asked by At

We have both pipeline and artifact under the same project. We set the role for '[project-name] Build Service ([company-name])' to 'Contributor' in Feed Settings > Permissions, following the instructions here: https://learn.microsoft.com/en-us/azure/devops/artifacts/feeds/feed-permissions?view=azure-devops#pipelines-permissions

When we run the pipeline we get the following error message:

Failed to read artifact descriptor for [package-name]: Could not transfer artifact [package-name] from/to [feed-name] ([feed-url]): authentication failed for [package-url], status: 401 Unauthorized -> [Help 1]

Is there any other way to give the right to pipeline to access packages in the feed/artifact?

1

There are 1 best solutions below

2
Bright Ran-MSFT On

you can try to check with the following things to resolve the issue:

  1. On the Feed Settings > Permissions page, ensure you have granted the following two identities with the required permissions.

    • {Project-Name} Build Service ({Organization-Name})
    • Project Collection Build Service ({Organization-Name})
  2. Try to re-create a new pipeline with the same definition.

  3. In the pipeline, try to use the associated authenticate task, such as Maven Authenticate task, NuGet authenticate task, etc...