从CLI获取Azure Devops NPM feed身份验证令牌 [英] Getting Azure Devops NPM feed Authentication Token from CLI
问题描述
我正在使用azure devops托管经过身份验证的NPM feed.我想生成一个令牌来使用CLI访问该供稿.关于azure devop的说明涉及通过Web界面生成个人访问令牌(PAT),然后对该令牌进行base64处理,然后将其添加到.npmrc中.如果这样做,我就可以对该供稿运行 npm install
了.
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.
在CLI中,我尝试使用 az帐户get-access-token
,获取该令牌并对其进行编码.但这似乎失败了,我想这是有道理的,因为它是天蓝色本身的象征,而不是天蓝色的发展者.
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?
推荐答案
az account get-access-token get a token for utilities to access Azure.
这不是Azure DevOps.
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.
您将必须通过Azure DevOps组织中的Web界面手动创建 PAT令牌.
这篇关于从CLI获取Azure Devops NPM feed身份验证令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!