Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Azure DevOps Extension for Azure CLI with Azure DevOps Server?

The Azure CLI with the Azure DevOps extension has replaced the VSTS CLI. But I can't find any sample on how to connect to Team Foundation Server (TFS) or Azure DevOps Server using Azure CLI with Azure DevOps extension.

I tried to create a PAT on my Azure DevOps Server with all scope permission. Then I use the following command to login:

az devops login --organization https://vm-dev-cgudevops/DefaultCollection --verbose

Here is what I've got:

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.

The token can't be wrong. I don't know what's going on.

like image 296
Will Huang Avatar asked Jan 27 '23 06:01

Will Huang


1 Answers

At present Azure DevOps CLI is not supported for Azure DevOps server. This is fundamentally due to API versioning as Azure DevOps Server runs on a particular version but the CLI client consistently updates to the latest version. Therefore, ideally if you are using the latest version of Azure DevOps Server, then the CLI should work for you as both are using the same API versions.

Have a look at the docs available at - https://learn.microsoft.com/en-us/azure/devops/cli/index?view=azure-devops

like image 103
georgeverghese Avatar answered Jan 28 '23 20:01

georgeverghese