ARTIFACTORY: Configuring Artifactory to Proxy an npm Package Feed in Azure DevOps
Relevant versions: This information pertains to Artifactory versions 5 and 6. For an Artifactory 7 tuning guide, please visit HERE.
As a universal repository manager, Artifactory supports all software packaging formats. You can also configure Artifactory to proxy an npm feed in Azure DevOps (formerly VSTS), where an npm feed is a repository or a registry that’s compatible with the npm client. To achieve this, you’ll need to create an npm-type remote repository and point the URL to the Azure feed:
By default, Azure DevOps uses personal access tokens for authentication. Artifactory supports multiple means of authentication. This includes the way Artifactory connects to Azure Devops, which is through Basic Authentication.
To successfully authenticate Artifactory with a remote npm Azure DevOps feed, you must create alternate credentials in Azure. This is because Artifactory currently does not support PAT authentication. These alternate credentials should be entered into the remote authentication field under the Advanced tab of the remote repository settings. Thereafter, tick the Bypass HEAD Requests option in the same tab. Note: The test button will return a Connection failed: Error 404: Not Found message due to HEAD requests not being accepted by Azure. Nevertheless, your packages will still be resolved from your remote Azure npm feed.
Once this setup has been completed, for the npm client to work with Artifactory, you should set the default npm registry in the .npmrc to the above created Artifactory npm remote repository. By doing this, all the packages available in your npm feed or private registry in Azure DevOps will be accessible from Artifactory.
Published: July 4, 2019
Last updated: Mar. 15, 2021
Keywords: Azure DevOps, VSTS