Getting Azure Devops NPM feed Authentication Token from CLI

五迷三道 提交于 2021-01-29 13:12:51

问题


I am using azure devops to host an authenticated NPM feed. I would like to generate a token to access that feed using the CLI. The instructions on azure devops involve going through the web interface to generate a personal access token (PAT), then base64-ing that token, and adding it to the .npmrc. If I do that, I'm able to run npm install against that feed without issue.

In the CLI, I've tried using az account get-access-token, grabbing that token, and encoding it. But that seems to fail, and I guess that makes sense because it is a token for azure itself, not azure devops.

Does anyone have any guidance on how this could be done? Am I stuck doing it manually?


回答1:


az account get-access-token get a token for utilities to access Azure.

It's not Azure DevOps.

We also have an az devops CLI command. But we could not be able to get/create a token through this. Neither does Rest API.

You'll have to manually create the PAT token from web interface in your Azure DevOps Organization.



来源:https://stackoverflow.com/questions/60870245/getting-azure-devops-npm-feed-authentication-token-from-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!