如何将适用于 Azure CLI 的 Azure DevOps 扩展与 Azure DevOps 服务器结合使用?

Wil*_*ang 5 azure-devops azure-devops-extensions azure-devops-server-2019

具有Azure DevOps 扩展的Azure CLI已取代VSTS CLI。但我找不到任何有关如何使用 Azure CLI 和 Azure DevOps 扩展连接到 Team Foundation Server (TFS) 或 Azure DevOps Server 的示例。

我尝试在 Azure DevOps 服务器上创建具有所有范围权限的 PAT。然后我使用以下命令登录:

az devops login --organization https://vm-dev-cgudevops/DefaultCollection --verbose
Run Code Online (Sandbox Code Playgroud)

这是我所得到的:

C:\>az devops login --organization https://vm-dev-cgudevops/DefaultCollection --verbose
Token:
Creating connection with personal access token.
Failed to authenticate using the supplied token.
Suppress exception There are no active accounts.
Suppress exception Please run 'az login' to setup account.
command ran in 25.138 seconds.
Run Code Online (Sandbox Code Playgroud)

令牌不可能错。我不知道发生了什么事。

Geo*_*ese 5

目前,Azure DevOps 服务器不支持 Azure DevOps CLI。这从根本上来说是由于 API 版本控制造成的,因为 Azure DevOps Server 在特定版本上运行,但 CLI 客户端始终更新到最新版本。因此,理想情况下,如果您使用的是最新版本的 Azure DevOps Server,那么 CLI 应该适合您,因为两者都使用相同的 API 版本。

查看可用的文档 - https://learn.microsoft.com/en-us/azure/devops/cli/index?view=azure-devops