共用方式為


az pipelines

Note

This reference is part of the azure-devops extension for the Azure CLI (version 2.30.0 or higher). The extension will automatically install the first time you run an az pipelines command. Learn more about extensions.

管理 Azure Pipelines。

此命令群組是 azure-devops 擴充功能的一部分。

命令

名稱 Description 類型 狀態
az pipelines agent

Manage agents.

Extension GA
az pipelines agent list

取得集區中的代理程序清單。

Extension GA
az pipelines agent show

顯示代理程序詳細數據。

Extension GA
az pipelines build

Manage builds.

Extension GA
az pipelines build cancel

如果組建正在執行,則取消。

Extension GA
az pipelines build definition

管理組建定義。

Extension GA
az pipelines build definition list

列出組建定義。

Extension GA
az pipelines build definition show

取得組建定義的詳細數據。

Extension GA
az pipelines build list

列出組建結果。

Extension GA
az pipelines build queue

要求 (佇列) 組建。

Extension GA
az pipelines build show

取得組建的詳細數據。

Extension GA
az pipelines build tag

管理組建標籤。

Extension GA
az pipelines build tag add

新增組建的標籤。。

Extension GA
az pipelines build tag delete

刪除組建標籤。

Extension GA
az pipelines build tag list

取得組建的標籤。

Extension GA
az pipelines create

建立新的 Azure Pipeline(YAML 型)。

Extension GA
az pipelines delete

刪除管線。

Extension GA
az pipelines folder

管理組織管線的資料夾。

Extension GA
az pipelines folder create

建立資料夾。

Extension GA
az pipelines folder delete

刪除資料夾。

Extension GA
az pipelines folder list

列出所有資料夾。

Extension GA
az pipelines folder update

更新資料夾名稱或描述。

Extension GA
az pipelines list

List pipelines.

Extension GA
az pipelines pool

管理代理程式集區。

Extension GA
az pipelines pool list

列出代理程式集區。

Extension GA
az pipelines pool show

顯示代理程式集區詳細數據。

Extension GA
az pipelines queue

管理代理程式佇列。

Extension GA
az pipelines queue list

列出代理程式佇列。

Extension GA
az pipelines queue show

顯示代理程式佇列的詳細數據。

Extension GA
az pipelines release

Manage releases.

Extension GA
az pipelines release create

要求 (建立) 發行。

Extension GA
az pipelines release definition

管理發行定義。

Extension GA
az pipelines release definition list

列出發行定義。

Extension GA
az pipelines release definition show

取得發行定義的詳細數據。

Extension GA
az pipelines release list

列出發行結果。

Extension GA
az pipelines release show

取得版本的詳細數據。

Extension GA
az pipelines run

佇列 (執行) 管線。

Extension GA
az pipelines runs

管理管線執行。

Extension GA
az pipelines runs artifact

管理管線執行成品。

Extension GA
az pipelines runs artifact download

下載管線成品。

Extension GA
az pipelines runs artifact list

列出與執行相關聯的成品。

Extension GA
az pipelines runs artifact upload

上傳管線成品。

Extension GA
az pipelines runs list

列出專案中執行的管線。

Extension GA
az pipelines runs show

顯示管線執行的詳細數據。

Extension GA
az pipelines runs tag

管理管線執行標籤。

Extension GA
az pipelines runs tag add

為管線執行新增 tag(s)。

Extension GA
az pipelines runs tag delete

刪除管線執行標記。

Extension GA
az pipelines runs tag list

取得管線執行的標籤。

Extension GA
az pipelines show

取得管線的詳細數據。

Extension GA
az pipelines update

更新管線。

Extension GA
az pipelines variable

管理管線變數。

Extension GA
az pipelines variable-group

管理變數群組。

Extension GA
az pipelines variable-group create

建立變數群組。

Extension GA
az pipelines variable-group delete

刪除變數群組。

Extension GA
az pipelines variable-group list

列出變數群組。

Extension GA
az pipelines variable-group show

顯示變數群組詳細數據。

Extension GA
az pipelines variable-group update

更新變數群組。

Extension GA
az pipelines variable-group variable

管理變數群組中的變數。

Extension GA
az pipelines variable-group variable create

將變數新增至變數群組。

Extension GA
az pipelines variable-group variable delete

從變數群組中刪除變數。

Extension GA
az pipelines variable-group variable list

列出變數群組中的變數。

Extension GA
az pipelines variable-group variable update

更新變數群組中的變數。

Extension GA
az pipelines variable create

將變數新增至管線。

Extension GA
az pipelines variable delete

從管線中刪除變數。

Extension GA
az pipelines variable list

列出管線中的變數。

Extension GA
az pipelines variable update

更新管線中的變數。

Extension GA

az pipelines create

建立新的 Azure Pipeline(YAML 型)。

az pipelines create --name
                    [--branch]
                    [--description]
                    [--detect {false, true}]
                    [--folder-path]
                    [--org --organization]
                    [--project]
                    [--queue-id]
                    [--repository]
                    [--repository-type {github, tfsgit}]
                    [--service-connection]
                    [--skip-first-run --skip-run {false, true}]
                    [--yaml-path --yml-path]

範例

從本機簽出存放庫內容建立 Azure Pipeline

Repository name/url (--repository), type (--repository-type) and branch name (--branch) will be detected from the local git repository
az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project'

使用複製 URL 為 Github 上裝載的存放庫建立 Azure Pipeline

az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project'
--repository https://github.com/SampleOrg/SampleRepo --branch master

針對裝載於 Github 組織 SampleOrg 的存放庫建立 Azure Pipeline,存放庫名稱 SampleRepo

az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project'
--repository SampleOrg/SampleRepoName --branch master --repository-type github

為裝載於相同專案中 Azure 存放庫的存放庫建立 Azure Pipeline

az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project'
--repository SampleRepoName --branch master --repository-type tfsgit

使用已簽入存放庫的管線 yaml 建立存放庫的 Azure Pipeline

Service connection required for non Azure Repos can be optionally provided in the command to run it non interatively
az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project'
--repository https://github.com/SampleOrg/SampleRepo --branch master --yml-path azure-pipelines.yml [--service-connection SERVICE_CONNECTION]

必要參數

--name

新管線的名稱。

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--branch

將設定管線的分支名稱。 如果省略,則會從本機存放庫自動偵測它。

--description

新管線的描述。

--detect

自動偵測組織。

屬性
接受的值: false, true
--folder-path

需要建立管線的資料夾路徑。 預設值為根資料夾。 e.g. "user1/test_pipelines".

--org --organization

Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/

--project -p

項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。

--queue-id

可用代理程式集區中佇列的標識碼。 如果未指定,將會自動偵測到 。

--repository

必須設定管線的存放庫。 在 GitHub 存放庫的情況下,可以是 Git 存放庫的 URL 或 Azure Repos 或 Owner/RepoName 的存放庫名稱。 如果省略,則會從本機 Git 存放庫的遠端 URL 自動偵測到。 如果提及 name 而不是 url,則也需要 --repository-type 自變數。

--repository-type

存放庫的類型。 如果省略,則會從本機存放庫的遠端 URL 自動偵測它。 適用於 Azure Repos 的 'tfsgit'、GitHub 存放庫的 'github'。

屬性
接受的值: github, tfsgit
--service-connection

為 GitHub 存放庫存放庫建立的服務連線標識碼。 使用 az devops service-endpoint -h 命令來建立/列出service_connections。 Azure Repos 不需要。

--skip-first-run --skip-run

指定此旗標以防止命令觸發第一次執行。 如果略過執行,命令會傳回管線,否則它會輸出管線執行。

屬性
接受的值: false, true
--yaml-path --yml-path

存放庫中管線 yaml 檔案的路徑(如果 yaml 已存在於存放庫中)。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az pipelines delete

刪除管線。

az pipelines delete --id
                    [--detect {false, true}]
                    [--org --organization]
                    [--project]
                    [--yes]

必要參數

--id

管線的標識碼。

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--detect

自動偵測組織。

屬性
接受的值: false, true
--org --organization

Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/

--project -p

項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。

--yes -y

請勿提示確認。

屬性
預設值: False
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az pipelines list

List pipelines.

az pipelines list [--detect {false, true}]
                  [--folder-path]
                  [--name]
                  [--org --organization]
                  [--project]
                  [--query-order {ModifiedAsc, ModifiedDesc, NameAsc, NameDesc, None}]
                  [--repository]
                  [--repository-type {bitbucket, git, github, githubenterprise, svn, tfsgit, tfsversioncontrol}]
                  [--top]

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--detect

自動偵測組織。

屬性
接受的值: false, true
--folder-path

如果指定,則會篩選至此資料夾底下的定義。

--name

將結果限製為具有此名稱的管線,或從這個名稱開始。 範例:“FabCI” 或 “Fab*”。

--org --organization

Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/

--project -p

項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。

--query-order

結果的順序。

屬性
接受的值: ModifiedAsc, ModifiedDesc, NameAsc, NameDesc, None
--repository

將結果限製為與此存放庫相關聯的管線。

--repository-type

將結果限製為與此存放庫類型相關聯的管線。 必須傳遞 『repository』 自變數和這個自變數。

屬性
接受的值: bitbucket, git, github, githubenterprise, svn, tfsgit, tfsversioncontrol
--top

要列出管線的數目上限。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az pipelines run

佇列 (執行) 管線。

az pipelines run [--branch]
                 [--commit-id]
                 [--detect {false, true}]
                 [--folder-path]
                 [--id]
                 [--name]
                 [--open]
                 [--org --organization]
                 [--parameters]
                 [--project]
                 [--variables]

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--branch

要排入佇列之管線執行的分支名稱。 範例:refs/heads/master 或 master 或 refs/pull/1/merge 或 refs/tags/tag。

--commit-id

要排入佇列之管線執行的認可標識碼。

--detect

自動偵測組織。

屬性
接受的值: false, true
--folder-path

管線的資料夾路徑。 預設值為根層級資料夾。

--id

要排入佇列之管線的標識碼。 如果未提供 --name,則為必要專案。

--name

要排入佇列的管線名稱。 如果提供 --id,則會忽略 。

--open

在網頁瀏覽器中開啟管線結果頁面。

屬性
預設值: False
--org --organization

Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/

--parameters

您要設定之參數的空間分隔 「name=value」 組。

--project -p

項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。

--variables

您要設定之變數的空間分隔 「name=value」 組。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az pipelines show

取得管線的詳細數據。

az pipelines show [--detect {false, true}]
                  [--folder-path]
                  [--id]
                  [--name]
                  [--open]
                  [--org --organization]
                  [--project]

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--detect

自動偵測組織。

屬性
接受的值: false, true
--folder-path

管線的資料夾路徑。 預設值為根層級資料夾。

--id

管線的標識碼。

--name

管線的名稱。 如果提供 --id,則會忽略 。

--open

在網頁瀏覽器中開啟管線摘要頁面。

屬性
預設值: False
--org --organization

Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/

--project -p

項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az pipelines update

更新管線。

az pipelines update --id
                    [--branch]
                    [--description]
                    [--detect {false, true}]
                    [--new-folder-path]
                    [--new-name]
                    [--org --organization]
                    [--project]
                    [--queue-id]
                    [--yaml-path --yml-path]

必要參數

--id

要更新之管線的標識碼。

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--branch

將設定管線的分支名稱。

--description

管線的新描述。

--detect

自動偵測組織。

屬性
接受的值: false, true
--new-folder-path

要移動管線之資料夾的新完整路徑。例如“user1/production_pipelines”。

--new-name

管線的新更新名稱。

--org --organization

Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/

--project -p

項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。

--queue-id

管線需要執行之代理程式集區的佇列標識碼。

--yaml-path --yml-path

存放庫中管線 yaml 檔案的路徑。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False