az pipelines

注意

此參考是 Azure CLI 的 azure-devops 延伸模組的一部分 (2.30.0 版或更高版本)。 擴充功能會在您第一次執行 az pipelines 命令時自動安裝。 深入了解擴充功能。

管理 Azure Pipelines。

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

命令

名稱 Description 類型 狀態
az pipelines agent

管理代理程式。

擴充 GA
az pipelines agent list

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

擴充 GA
az pipelines agent show

顯示代理程式詳細資料。

擴充 GA
az pipelines build

管理組建。

擴充 GA
az pipelines build cancel

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

擴充 GA
az pipelines build definition

管理組建定義。

擴充 GA
az pipelines build definition list

列出組建定義。

擴充 GA
az pipelines build definition show

取得組建定義的詳細資料。

擴充 GA
az pipelines build list

列出組建結果。

擴充 GA
az pipelines build queue

要求 (佇列) 組建。

擴充 GA
az pipelines build show

取得組建的詳細資料。

擴充 GA
az pipelines build tag

管理組建標籤。

擴充 GA
az pipelines build tag add

新增組建的標籤。。

擴充 GA
az pipelines build tag delete

刪除組建標籤。

擴充 GA
az pipelines build tag list

取得組建的標籤。

擴充 GA
az pipelines create

建立新的 Azure Pipeline(YAML 型)。

擴充 GA
az pipelines delete

刪除管線。

擴充 GA
az pipelines folder

管理組織管線的資料夾。

擴充 GA
az pipelines folder create

建立資料夾。

擴充 GA
az pipelines folder delete

刪除資料夾。

擴充 GA
az pipelines folder list

列出所有資料夾。

擴充 GA
az pipelines folder update

更新資料夾名稱或描述。

擴充 GA
az pipelines list

列出管線。

擴充 GA
az pipelines pool

管理代理程式組件區。

擴充 GA
az pipelines pool list

列出代理程式組件區。

擴充 GA
az pipelines pool show

顯示代理程式組件區詳細資料。

擴充 GA
az pipelines queue

管理代理程式佇列。

擴充 GA
az pipelines queue list

列出代理程式佇列。

擴充 GA
az pipelines queue show

顯示代理程式佇列的詳細資料。

擴充 GA
az pipelines release

管理版本。

擴充 GA
az pipelines release create

要求 (建立) 發行。

擴充 GA
az pipelines release definition

管理發行定義。

擴充 GA
az pipelines release definition list

列出發行定義。

擴充 GA
az pipelines release definition show

取得發行定義的詳細資料。

擴充 GA
az pipelines release list

列出發行結果。

擴充 GA
az pipelines release show

取得版本的詳細資料。

擴充 GA
az pipelines run

佇列 (執行) 管線。

擴充 GA
az pipelines runs

管理管線執行。

擴充 GA
az pipelines runs artifact

管理管線執行成品。

擴充 GA
az pipelines runs artifact download

下載管線成品。

擴充 GA
az pipelines runs artifact list

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

擴充 GA
az pipelines runs artifact upload

上傳管線成品。

擴充 GA
az pipelines runs list

列出專案中執行的管線。

擴充 GA
az pipelines runs show

顯示管線執行的詳細資料。

擴充 GA
az pipelines runs tag

管理管線執行標籤。

擴充 GA
az pipelines runs tag add

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

擴充 GA
az pipelines runs tag delete

刪除管線執行標記。

擴充 GA
az pipelines runs tag list

取得管線執行的標籤。

擴充 GA
az pipelines show

取得管線的詳細資料。

擴充 GA
az pipelines update

更新管線。

擴充 GA
az pipelines variable

管理管線變數。

擴充 GA
az pipelines variable-group

管理變數群組。

擴充 GA
az pipelines variable-group create

建立變數群組。

擴充 GA
az pipelines variable-group delete

刪除變數群組。

擴充 GA
az pipelines variable-group list

列出變數群組。

擴充 GA
az pipelines variable-group show

顯示變數群組詳細資料。

擴充 GA
az pipelines variable-group update

更新變數群組。

擴充 GA
az pipelines variable-group variable

管理變數群組中的變數。

擴充 GA
az pipelines variable-group variable create

將變數新增至變數群組。

擴充 GA
az pipelines variable-group variable delete

從變數群組中刪除變數。

擴充 GA
az pipelines variable-group variable list

列出變數群組中的變數。

擴充 GA
az pipelines variable-group variable update

更新變數群組中的變數。

擴充 GA
az pipelines variable create

將變數新增至管線。

擴充 GA
az pipelines variable delete

從管線中刪除變數。

擴充 GA
az pipelines variable list

列出管線中的變數。

擴充 GA
az pipelines variable update

更新管線中的變數。

擴充 GA

az pipelines create

建立新的 Azure Pipeline(YAML 型)。

az pipelines create --name
                    [--branch]
                    [--description]
                    [--detect {false, true}]
                    [--folder-path]
                    [--org]
                    [--project]
                    [--queue-id]
                    [--repository]
                    [--repository-type {github, tfsgit}]
                    [--service-connection]
                    [--skip-first-run {false, true}]
                    [--yaml-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

新管線的名稱。

選擇性參數

--branch

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

--description

新管線的描述。

--detect

自動偵測組織。

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

需要建立管線的資料夾路徑。 預設值為根資料夾。 例如「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 組態挑選,則為必要專案。

--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

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az pipelines delete

刪除管線。

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

必要參數

--id

管線的識別碼。

選擇性參數

--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 組態挑選,則為必要專案。

--yes -y

不提示確認。

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

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az pipelines list

列出管線。

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

選擇性參數

--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 組態挑選,則為必要專案。

--query-order

結果的順序。

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

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

--repository-type

將結果限制為與此存放庫類型相關聯的管線。 必須傳遞 'repository' 引數和這個引數。

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

要列出管線的數目上限。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az pipelines run

佇列 (執行) 管線。

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

選擇性參數

--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 組態挑選,則為必要專案。

--variables

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

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az pipelines show

取得管線的詳細資料。

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

選擇性參數

--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 組態挑選,則為必要專案。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az pipelines update

更新管線。

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

必要參數

--id

要更新之管線的識別碼。

選擇性參數

--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 組態挑選,則為必要專案。

--queue-id

管線需要執行之代理程式組件區的佇列識別碼。

--yaml-path --yml-path

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

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。