Skip to content

Latest commit

 

History

History
97 lines (72 loc) · 4.23 KB

index.md

File metadata and controls

97 lines (72 loc) · 4.23 KB
title titleSuffix description ms.topic ms.prod ms.technology ms.manager ms.author author monikerRange ms.date
Learn about Azure DevOps command line interface extension
Azure DevOps
Use Azure DevOps extension command line interface
conceptual
devops
devops-reference
mijacobs
kaelli
KathrynEE
azure-devops
10/14/2019

Get started with Azure DevOps CLI

[!INCLUDE temp]

The Azure DevOps extension for Azure Command Line Interface (CLI) allows you to experience Azure DevOps Services from the command line, bringing the capability to manage Azure DevOps right to your fingertips! This allows you to work in a streamlined task/command oriented manner without having to worry about the GUI flows, providing you a faster and flexible interaction canvas.

Note

The Azure DevOps Command Line Interface (CLI) is only available for Azure DevOps Services at this time.

To start using the Azure DevOps extension for Azure CLI, execute the following steps:

  1. Install Azure CLI: Follow the instructions available here to set up Azure CLI in your environment. At a minimum, your Azure CLI version must be 2.0.69. You can use az --version to validate.

  2. Add the Azure DevOps extension:

    az extension add --name azure-devops
    

    You can use az extension list or az extension show --name azure-devops to confirm the installation.

  3. Sign in: Run az login to sign in. Note that we support only interactive or log in using user name and password with az login. We do not support use of service principals with az login. You would need to use a PAT token in this case. For more information, see Log in via Azure DevOps Personal Access Token (PAT).

  4. Configure defaults: Although you can provide the organization and project for each command, we recommend you set these values as defaults in configuration for seamless commanding.

    az devops configure --defaults organization=https://dev.azure.com/contoso project=ContosoWebApp
    

Command usage

Adding the Azure DevOps Extension adds devops, pipelines, artifacts, boards, and repos groups. For usage and help content for any command, pass in the -h parameter, for example:

$ az devops -h
   
Group
    az devops : Manage Azure DevOps organization level operations.
        Related Groups
        az pipelines: Manage Azure Pipelines
        az boards: Manage Azure Boards
        az repos: Manage Azure Repos
        az artifacts: Manage Azure Artifacts.
   
Subgroups:
    admin            : Manage administration operations.
    extension        : Manage extensions.
    project          : Manage team projects.
    security         : Manage security related operations.
    service-endpoint : Manage service endpoints/service connections.
    team             : Manage teams.
    user             : Manage users.
    wiki             : Manage wikis.

Commands:
    configure        : Configure the Azure DevOps CLI or view your configuration.
    feedback         : Displays information on how to provide feedback to the Azure DevOps CLI team.
    invoke           : This command will invoke request for any DevOps area and resource. Please use
                       only json output as the response of this command is not fixed. Helpful docs -
                       https://docs.microsoft.com/rest/api/azure/devops/.
    login            : Set the credential (PAT) to use for a particular organization.
    logout           : Clear the credential for all or a particular organization.

Open items in browser

You can use --open switch to open any artifact in Azure DevOps portal in your default browser.

For example :

az pipelines build show --id 1 --open

This command will show the details of build with id 1 on the command-line and also open it in the default browser.

Related articles