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?
you can try to check with the following things to resolve the issue:
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})Try to re-create a new pipeline with the same definition.
In the pipeline, try to use the associated authenticate task, such as Maven Authenticate task, NuGet authenticate task, etc...