Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Pipeline - npm install error 403 with Azure Feed

My NPM install step is configured to use registries in .npmrc,

config My .npmrc is as follows

registry=https://pkgs.dev.azure.com/xxx/xxxx-xxxx-xxxx/_packaging/design-system/npm/registry/

always-auth=true

The Azure Artifacts feed is set-up, and a local npm install from my dev machine works completely fine. azure artifacts

However the pipeline's npm install job always fails with error 403.

npm install in pipeline

What am I doing wrong here? I've also tried changing the npm install task to use Registry I select here, and linking it to my "design-system" feed directly, but it results in the same error. I've followed all the steps here https://learn.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows, but it just doesn't work. Thanks

like image 864
Jason Avatar asked Mar 28 '20 21:03

Jason


People also ask

How do I run NPM on Azure pipeline?

You can either commit a . npmrc file to your source code repository and set its path or select a registry from Azure Artifacts. Select this option to use feeds specified in a . npmrc file you've checked into source control.

What is azure NPM?

Network Performance Monitor (NPM) is a cloud-based network monitoring solution that monitors connectivity between Azure cloud deployments and on-premises locations (Branch offices, etc.). NPM is part of Azure Monitor logs.


Video Answer


2 Answers

Problem solved. What I had to do was go under into the feed -> settings -> permissions, and add the ...Build Service... as a Contributor.

solved

Microsoft should really add this as part of their documentation. Took me several hours of random attempts before I found it..

like image 128
Jason Avatar answered Oct 21 '22 08:10

Jason


This is a different solution for the same message, although, in this case it will fail from any location.

Trying to publish a package version previous to the last one published on the feed will return the 403 Forbidden error to, even if it's not a permissions issue.

Updating the package version to one increment after the current version will solve the problem.

like image 1
gabykotliar Avatar answered Oct 21 '22 07:10

gabykotliar