Azure DevOps Services
このクイック スタートでは、Azure コマンド ライン インターフェイス (CLI) 用の Azure DevOps 拡張機能の設定と使用を開始します。 Azure CLI を使用すると、コマンド ラインから多くの Azure DevOps Services を管理できます。 Azure CLI コマンドを使用すると、ユーザー インターフェイス ワークフローをバイパスして、より高速で柔軟な対話型キャンバスを使用してタスクを効率化できます。
注
Azure DevOps CLI は、Azure DevOps Services でのみ使用できます。 Azure CLI 用の Azure DevOps 拡張機能では、Azure DevOps Server のバージョンはサポートされていません。
Azure CLI 用の Azure DevOps 拡張機能の使用を開始するには:
Azure CLI をインストールします。 Azure CLI のインストールに関するページの手順に従って、Azure CLI 環境を設定します。 Azure CLI のバージョンは、少なくとも 2.10.1 以降である必要があります。
az --version
コマンドを使用して検証できます。Azure DevOps 拡張機能を追加します。
az extension add --name azure-devops
インストールを確認するには、コマンド
az extension list
またはaz extension show --name azure-devops
を実行します。サインインするには、
az login
コマンドを実行します。 Azure CLI では、az login
でユーザー名とパスワードを使用した対話型サインインのみがサポートされます。 個人用アクセス トークン (PAT) を使用してサインインするには、「 Azure DevOps PAT を使用したサインイン」を参照してください。注
Azure DevOps 拡張機能は現在、 マネージド ID を使用した認証をサポートしていません。
組織とプロジェクトの既定の構成を設定することをお勧めします。 それ以外の場合は、個々のコマンド自体で値を指定できます。
az devops configure --defaults organization=https://dev.azure.com/contoso project=ContosoWebApp
コマンドを使用する
Azure DevOps 拡張機能を追加すると、devops
、pipelines
、artifacts
、boards
、および repos
のグループが追加されます。
コマンドの使用法とヘルプ コンテンツについては、 --help
パラメーターを指定します。次に例を示します。
az devops --help
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://learn.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
パラメーターを使用して、既定のブラウザーで Azure DevOps ポータルで任意の成果物を開くことができます。
az pipelines build show --id 1 --open
このコマンドは、コマンド プロンプト ウィンドウに --id 1
を使用してビルドの詳細を表示し、既定のブラウザーで開きます。