2

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:

DevOps PAT settings

Any guesses where I might be going wrong?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Jason
  • 2,455
  • 4
  • 37
  • 48
  • Open the Artifacts > Feed > Feed Settings (Cog) > Permissions . Are you a contributor or owner for the feed you are trying to upload to? – Dejulia489 Jan 05 '19 at 00:12
  • For future reference, you should redact things like auth tokens when posting logs to public sites. You redacted your account name, but your profile shows your employer and that's all a determined attacker needs. – Daniel Mann Jan 05 '19 at 03:09
  • 1
    @DanielMann I totally agree. I left it in because there was a previous issue reported where the instructions were Base64 encoding the token incorrectly. I wanted to show that it was the correct format. Don't worry though, I'd already revoked the token before posting. – Jason Jan 05 '19 at 16:44
  • @michaeldejulia Yes, I'm the owner for the feed. – Jason Jan 05 '19 at 16:54

1 Answers1

4

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

enter image description here

enter image description here

Tom Sun - MSFT
  • 24,161
  • 3
  • 30
  • 47