在Azure管道中出现404错误,以从AZURE-ARTIFACT获取NPM软件包? [英] Getting 404 error in azure-pipeline to fetch NPM packages from AZURE-ARTIFACT?

查看:48
本文介绍了在Azure管道中出现404错误,以从AZURE-ARTIFACT获取NPM软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在azure-artifact中,我们在拥有NPM软件包的地方设置了项目范围"供稿名称"feed1".该提要已附加到"Project1"上.

现在,我的"Project2"管道无法从"feed1"中获取软件包.

注意:所有NPM软件包都存在于AZURE-ARTIFACT中,但仍然出现404错误.a

解决方案

现在,我的"Project2"管道无法从"feed1"中获取软件包.

由于这是Project1中的项目范围供稿,因此默认情况下,Project2的管道无法从 feed1 中找到包.这是设计行为.

如果您使用的是

然后,您可以尝试以下步骤来解决该问题:

1.Go Organization Settings =>设置(管道)以禁用 将作业授权范围限制为当前项目选项.(管道可以与集合作用域访问令牌一起运行,除非启用此选项.启用此选项后,您可以减小对当前项目的所有管道的访问范围.)

2.然后在 Project2 中:转到Project Settings => Settings(管道)并 disable 将作业授权范围限制为当前项目.这样, Project2 的管道就可以使用集合范围的访问令牌访问 project1 的提要.

3.如果问题仍然存在,请再次运行 Project2 的管道.然后检查feed1的

In azure-artifact we setup a "project scope" feed name "feed1" where we have NPM packages. This feed has been attached to "Project1".

Now my "Project2" pipeline is not able to fetch package from "feed1".

NOTE: All NPM packages exist in AZURE-ARTIFACT but still I'm getting 404 error.a

解决方案

Now my "Project2" pipeline is not able to fetch package from "feed1".

Since that's a project-scoped feed within Project1, your Project2's pipeline can't find the package from feed1 by default. It's by design behavior.

If you're using Npm Install task to install the packages with this option:

Then you can try steps below to resolve that issue:

1.Go Organization Settings=>Settings(Pipelines) to disable Limit job authorization scope to current project option. (Pipelines can run with collection scoped access tokens unless this option is enabled. With this option enabled, you can reduce the scope of access for all pipelines to the current project.)

2.Then in Project2: Go Project Settings=>Settings(Pipelines) and disable Limit job authorization scope to current project option. So that Project2's pipeline can access project1's feed with collection scoped access token.

3.Run the Project2's pipeline again, if the issue persists. Then check feed1's feed settings:

  • Add Project2 Build Service as Contributor role in Permissions.

  • Edit the Views's settings and make sure your Project2 can access them.

(If the missing package comes from local view/Upstream source, edit the Local view. If the missing package comes from PreRelease/Release view, edit corresponding views.)

这篇关于在Azure管道中出现404错误,以从AZURE-ARTIFACT获取NPM软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆