Azure DevOps Artifacts 401 error when publishing n

2019-08-28 05:36发布

问题:

I'm trying to get Azure DevOps Artifacts service up and running. I can get it to work with the 90-day token generated by DevOps but not with a custom PAT generated by my account Security panel. It just gives me a 401 error. I followed the instructions for the PAT from here: PAT instructions

My registry url is https://pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/

My extension .npmrc file is like this:

registry=https://pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/
always-auth=true

My system .npmrc is like this:

//registry.npmjs.org/:_authToken=xxxxxxxxxxxxxxxxxxxxxxxx
//pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/:username=mycompany
//pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/:_password=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/:email=devservices@mycompany.ca
//pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/:always-auth=true

If it helps, here's the settings I used to generate the PAT:

Any guesses where I might be going wrong?

回答1:

Any guesses where I might be going wrong?

Please have a try to generate a PAT with a narrow scope of "Packaging (read and write), not build permission. You could click the [show all scopes] to find it.

For more information, please refer to set up your npmrc files