0

I have a react application whose deployment is done through Jenkins pipeline. package.json uses a private feed present in Azure Devops Artifcats.

I want to authenticate the .npmrc present in gitlab , to azure devops using my jenkins pipeline. Could you please advice How to do that?

I would like to know if there is a way to authenticate azure devops private feeds using service principle from a jenkins pieline.

Anjali
  • 1
  • 2

1 Answers1

0

I want to authenticate the .npmrc present in gitlab , to azure devops using my jenkins pipeline. Could you please advice How to do that?

You can add the .npmrc file to the same path as Package.json file.

Then you can add the following content in the .npmrc file

; begin auth token
//pkgs.dev.azure.com/orgname/projectname/_packaging/feedname/npm/registry/:username=xx
//pkgs.dev.azure.com/orgname/projectname/_packaging/feedname/npm/registry/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
//pkgs.dev.azure.com/orgname/projectname/_packaging/feedname/npm/registry/:email=npm requires email to be set but doesn't use the value
//pkgs.dev.azure.com/orgname/projectname/_packaging/feedname/npm/:username=xxx
//pkgs.dev.azure.com/orgname/projectname/_packaging/feedname/npm/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
//pkgs.dev.azure.com/orgname/projectname/_packaging/feedname/npm/:email=npm requires email to be set but doesn't use the value
; end auth token

You need to generate PAT in Azure DevOps, then transfer it to Based64 type and add it to .npmrc file to authenticate the feed.

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28