How to install Azure DevOps Extension in Azure CLI? The post How to install Azure DevOps Extension in Azure CLI? appeared first on The Automation Code.
Why do we need an Azure DevOps (ADO) extension in Azure CLI?
Well, you know how to manage Azure DevOps services (Pipeline, workItems, Repo, Artifacts, etc) from the portal. If you are a DevOps engineer or Automation guy then you would love to manage the ADO services with the command line (Azure CLI).
Managing ADO services with the command line is very easy and makes your work faster like managing pipelines, work items, artifacts, etc.
Pre-Requisites:
Azure CLI Tool installed (must be above 2.10.1).
Azure DevOps Account
Once you have Azure CLI installed, you are eligible to install the extension but make sure you have a CLI version above 2.10.1.
To check the Azure CLI version, run the below command on any terminal (PowerShell, cmd, or any other terminal).
az --version
Add Extension
To add an extension in Azure CLI, you need to use the az extension add command with the –name parameter that specifies the extension name. The extension name for devops is azure-devops.
az extension add --name azure-devopsYou can check the installed extension using the below command. This will list down all the installed extensions in the tabular format.
az extension list -otableOr you can directly search for the installed extension with the below command.
az extension show --name azure-devops -otableAzure DevOps extension
Once you see the extension, check all the services that are offered by this extension.
az devops -h
Login to Azure DevOps
There are two ways to login to DevOps services.
Interactive Login Login using PATFor interactive login, you need to use the az login command.
az loginOnce you run this command, the browser will open for the authentication and you have to enter your Azure credentials.
For login using PAT, run the below command.
az devops login --organization https://dev.azure.com/organizationNameThat will ask for the PAT token.
Configure Default organization
To work on the specific project of the organization, you need to set the default organization.
az devops configure --defaults organization=https://dev.azure.com/OrganizationName project=projectNameTo get more help with this extension, you need to run
az devops -hThe post How to install Azure DevOps Extension in Azure CLI? appeared first on The Automation Code.