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 擴充功能的一部分。
命令
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]
必要參數
新管線的名稱。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
將設定管線的分支名稱。 如果省略,則會從本機存放庫自動偵測它。
新管線的描述。
自動偵測組織。
屬性 | 值 |
---|---|
接受的值: | false, true |
需要建立管線的資料夾路徑。 預設值為根資料夾。 e.g. "user1/test_pipelines".
Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/
。
項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。
可用代理程式集區中佇列的標識碼。 如果未指定,將會自動偵測到 。
必須設定管線的存放庫。 在 GitHub 存放庫的情況下,可以是 Git 存放庫的 URL 或 Azure Repos 或 Owner/RepoName 的存放庫名稱。 如果省略,則會從本機 Git 存放庫的遠端 URL 自動偵測到。 如果提及 name 而不是 url,則也需要 --repository-type 自變數。
存放庫的類型。 如果省略,則會從本機存放庫的遠端 URL 自動偵測它。 適用於 Azure Repos 的 'tfsgit'、GitHub 存放庫的 'github'。
屬性 | 值 |
---|---|
接受的值: | github, tfsgit |
為 GitHub 存放庫存放庫建立的服務連線標識碼。 使用 az devops service-endpoint -h 命令來建立/列出service_connections。 Azure Repos 不需要。
指定此旗標以防止命令觸發第一次執行。 如果略過執行,命令會傳回管線,否則它會輸出管線執行。
屬性 | 值 |
---|---|
接受的值: | false, true |
存放庫中管線 yaml 檔案的路徑(如果 yaml 已存在於存放庫中)。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az pipelines delete
刪除管線。
az pipelines delete --id
[--detect {false, true}]
[--org --organization]
[--project]
[--yes]
必要參數
管線的標識碼。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
自動偵測組織。
屬性 | 值 |
---|---|
接受的值: | false, true |
Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/
。
項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。
請勿提示確認。
屬性 | 值 |
---|---|
預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --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.
自動偵測組織。
屬性 | 值 |
---|---|
接受的值: | false, true |
如果指定,則會篩選至此資料夾底下的定義。
將結果限製為具有此名稱的管線,或從這個名稱開始。 範例:“FabCI” 或 “Fab*”。
Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/
。
項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。
結果的順序。
屬性 | 值 |
---|---|
接受的值: | ModifiedAsc, ModifiedDesc, NameAsc, NameDesc, None |
將結果限製為與此存放庫相關聯的管線。
將結果限製為與此存放庫類型相關聯的管線。 必須傳遞 『repository』 自變數和這個自變數。
屬性 | 值 |
---|---|
接受的值: | bitbucket, git, github, githubenterprise, svn, tfsgit, tfsversioncontrol |
要列出管線的數目上限。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --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.
要排入佇列之管線執行的分支名稱。 範例:refs/heads/master 或 master 或 refs/pull/1/merge 或 refs/tags/tag。
要排入佇列之管線執行的認可標識碼。
自動偵測組織。
屬性 | 值 |
---|---|
接受的值: | false, true |
管線的資料夾路徑。 預設值為根層級資料夾。
要排入佇列之管線的標識碼。 如果未提供 --name,則為必要專案。
要排入佇列的管線名稱。 如果提供 --id,則會忽略 。
在網頁瀏覽器中開啟管線結果頁面。
屬性 | 值 |
---|---|
預設值: | False |
Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/
。
您要設定之參數的空間分隔 「name=value」 組。
項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。
您要設定之變數的空間分隔 「name=value」 組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --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.
自動偵測組織。
屬性 | 值 |
---|---|
接受的值: | false, true |
管線的資料夾路徑。 預設值為根層級資料夾。
管線的標識碼。
管線的名稱。 如果提供 --id,則會忽略 。
在網頁瀏覽器中開啟管線摘要頁面。
屬性 | 值 |
---|---|
預設值: | False |
Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/
。
項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --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]
必要參數
要更新之管線的標識碼。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
將設定管線的分支名稱。
管線的新描述。
自動偵測組織。
屬性 | 值 |
---|---|
接受的值: | false, true |
要移動管線之資料夾的新完整路徑。例如“user1/production_pipelines”。
管線的新更新名稱。
Azure DevOps 組織 URL。 您可以使用 az devops configure -d organization=ORG_URL 來設定預設組織。 如果未設定為預設,或透過 git 組態挑選,則為必要專案。範例:https://dev.azure.com/MyOrganizationName/
。
項目的名稱或識別碼。 您可以使用 az devops configure -d project=NAME_OR_ID 來設定預設專案。 如果未設定為預設,或未透過 git config 自動取得,則為必要。
管線需要執行之代理程式集區的佇列標識碼。
存放庫中管線 yaml 檔案的路徑。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |