Azure DevOps CLI の概要Get started with Azure DevOps CLI
Azure DevOps Services | Azure DevOps Server 2020Azure DevOps Services | Azure DevOps Server 2020
Azure コマンド ライン インターフェイス (CLI) 用の Azure DevOps 拡張機能を使用すると、コマンド ラインから多くの Azure DevOps Services を管理できます。With the Azure DevOps extension for Azure Command Line Interface (CLI), you can manage many Azure DevOps Services from the command line. CLI コマンドを使用すると、高速で柔軟な対話型キャンバスによりユーザー インターフェイス ワークフローがバイパスされ、タスクを効率化できます。CLI commands enable you to streamline your tasks with faster and flexible interactive canvas, bypassing user interface workflows.
注意
Azure DevOps Server 2020 および Azure DevOps Services では、Azure DevOps コマンド ライン インターフェイス (CLI) を使用できます。The Azure DevOps Command Line Interface (CLI) is available for Azure DevOps Server 2020 and Azure DevOps Services.
Azure CLI で Azure DevOps 拡張機能の使用を開始するには、次のステップを実行します。To start using the Azure DevOps extension for Azure CLI, perform the following steps:
Azure CLI をインストールします: 「Azure CLI のインストール」に記載されている手順に従って、Azure CLI 環境をセットアップします。Install Azure CLI: Follow the instructions provided in Install the Azure CLI to set up your Azure CLI environment. Azure CLI のバージョンは、少なくとも 2.10.1 以降である必要があります。At a minimum, your Azure CLI version must be 2.10.1. 検証するには、
az --version
を使用します。You can useaz --version
to validate.Azure DevOps 拡張機能を追加します:Add the Azure DevOps extension:
az extension add --name azure-devops
az extension list
またはaz extension show --name azure-devops
を使用して、インストールを確認できます。You can useaz extension list
oraz extension show --name azure-devops
to confirm the installation.サインインします:
az login
を実行してサインインします。Sign in: Runaz login
to sign in. サポートされているのは、対話型、またはaz login
によるユーザー名とパスワードを使用したログインのみです。Note that we support only interactive or log in using user name and password withaz login
. 個人用アクセス トークン (PAT) を使用してサインインするには、Azure DevOps 個人用アクセス トークン (PAT) を使用したサインインに関する記事を参照してください。To sign in using a Personal Access Token (PAT), see Sign in via Azure DevOps Personal Access Token (PAT). オンプレミスのサーバー インスタンスに接続している場合は、select コマンドの実行に PAT を使用したサインインが必要になる場合があります。When connecting to an on-premises server instance, sign in using a PAT may be required to run select commands.既定値を構成します: 組織およびプロジェクトの既定の構成を設定することをお勧めします。Configure defaults: We recommend you set the default configuration for your organization and project. それ以外の場合は、個々のコマンド内でこれらの設定を行うことができます。Otherwise, you can set these within the individual commands themselves.
az devops configure --defaults organization=https://dev.azure.com/contoso project=ContosoWebApp
Azure DevOps Server に接続している場合は、サーバー インスタンスの URL を指定します。If you're connecting to an Azure DevOps Server, specify the URL for your server instance. 次に例を示します。For example:
az devops configure --defaults organization=https://ServerName/CollectionName project=ProjectName
コマンドの使用方法Command usage
Azure DevOps 拡張機能を追加すると、devops
、pipelines
、artifacts
、boards
、および repos
のグループが追加されます。Adding the Azure DevOps Extension adds devops
, pipelines
, artifacts
, boards
, and repos
groups.
任意のコマンドの使用方法とヘルプ コンテンツを参照するには、 -h パラメーターを入力します。次に例を示します。For usage and help content for any command, enter 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
--open
スイッチを使用すると、既定のブラウザーで Azure DevOps ポータルの任意の成果物を開くことができます。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
このコマンドでは、id 1
でのビルドの詳細がコマンド ラインに表示され、それが既定のブラウザーでも開きます。This command shows the details of build with id 1
on the command-line and also opens it in the default browser.