Share via


az devcenter admin project-environment-type

注意

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

管理專案環境類型。

命令

名稱 Description 類型 狀態
az devcenter admin project-environment-type create

建立項目環境類型。

副檔名 GA
az devcenter admin project-environment-type delete

刪除項目環境類型。

副檔名 GA
az devcenter admin project-environment-type list

列出項目的環境類型。

副檔名 GA
az devcenter admin project-environment-type show

取得項目環境類型。

副檔名 GA
az devcenter admin project-environment-type update

更新項目環境類型。

副檔名 GA

az devcenter admin project-environment-type create

建立項目環境類型。

az devcenter admin project-environment-type create --deployment-target-id
                                                   --environment-type-name
                                                   --identity-type {None, SystemAssigned, SystemAssigned, UserAssigned, UserAssigned}
                                                   --project
                                                   --resource-group
                                                   --roles
                                                   --status {Disabled, Enabled}
                                                   [--display-name]
                                                   [--location]
                                                   [--tags]
                                                   [--user-assigned-identities]
                                                   [--user-role-assignments]

範例

建立

az devcenter admin project-environment-type create --identity-type "UserAssigned" --user-assigned-identities "{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1\":{}}" --roles "{\"4cbf0b6c-e750-441c-98a7-10da8387e4d6\":{}}" --deployment-target-id "/subscriptions/00000000-0000-0000-0000-000000000000" --status "Enabled" --user-role-assignments "{\"e45e3m7c-176e-416a-b466-0c5ec8298f8a\":{\"roles\":{\"4cbf0b6c-e750-441c-98a7-10da8387e4d6\":{}}}}" --tags CostCenter="RnD" --environment-type-name "DevTest" --project-name "ContosoProj" --resource-group "rg1"

必要參數

--deployment-target-id

將對應環境類型之訂用帳戶的標識碼。 環境的資源將會部署到此訂用帳戶。

--environment-type-name --name -n

環境類型的名稱。

--identity-type

受控服務識別的類型(允許 SystemAssigned 和 UserAssigned 類型)。

接受的值: None, SystemAssigned, SystemAssigned, UserAssigned, UserAssigned
--project --project-name

專案的名稱。 使用 az configure -d project=<project_name> 來設定預設值。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--roles

要指派給環境建立者的角色對應。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--status

定義此環境類型是否可用於此專案。

接受的值: Disabled, Enabled

選擇性參數

--display-name

項目環境類型的顯示名稱。

--location -l

資源所在的地理位置。 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--tags

資源標籤。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--user-assigned-identities -u

與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中的空白物件 ({})。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--user-role-assignments

在環境備份資源上建立的角色指派。 這是從用戶物件識別碼到角色定義標識元對象的對應。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

全域參數
--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 devcenter admin project-environment-type delete

刪除項目環境類型。

az devcenter admin project-environment-type delete [--environment-type-name]
                                                   [--ids]
                                                   [--project]
                                                   [--resource-group]
                                                   [--subscription]
                                                   [--yes]

範例

刪除

az devcenter admin project-environment-type delete --environment-type-name "DevTest" --project-name "ContosoProj" --resource-group "rg1"

選擇性參數

--environment-type-name --name -n

環境類型的名稱。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--project --project-name

專案的名稱。 使用 az configure -d project=<project_name> 來設定預設值。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--subscription

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

--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 devcenter admin project-environment-type list

列出項目的環境類型。

az devcenter admin project-environment-type list --project
                                                 --resource-group
                                                 [--max-items]
                                                 [--next-token]

範例

清單​​

az devcenter admin project-environment-type list --project-name "ContosoProj" --resource-group "rg1"

必要參數

--project --project-name

專案的名稱。 使用 az configure -d project=<project_name> 來設定預設值。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--max-items

命令輸出中要傳回的項目總數。 如果可用的專案總數超過指定的值,則會在命令的輸出中提供令牌。 若要繼續分頁,請在後續命令的自變數中 --next-token 提供令牌值。

--next-token

標記,指定要開始分頁的位置。 這是先前截斷回應中的令牌值。

全域參數
--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 devcenter admin project-environment-type show

取得項目環境類型。

az devcenter admin project-environment-type show [--environment-type-name]
                                                 [--ids]
                                                 [--project]
                                                 [--resource-group]
                                                 [--subscription]

範例

Get

az devcenter admin project-environment-type show --environment-type-name "DevTest" --project-name "ContosoProj" --resource-group "rg1"

選擇性參數

--environment-type-name --name -n

環境類型的名稱。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--project --project-name

專案的名稱。 使用 az configure -d project=<project_name> 來設定預設值。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--subscription

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

全域參數
--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 devcenter admin project-environment-type update

更新項目環境類型。

az devcenter admin project-environment-type update [--add]
                                                   [--deployment-target-id]
                                                   [--display-name]
                                                   [--environment-type-name]
                                                   [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                                   [--identity-type {None, SystemAssigned, SystemAssigned, UserAssigned, UserAssigned}]
                                                   [--ids]
                                                   [--project]
                                                   [--remove]
                                                   [--resource-group]
                                                   [--roles]
                                                   [--set]
                                                   [--status {Disabled, Enabled}]
                                                   [--subscription]
                                                   [--tags]
                                                   [--user-assigned-identities]
                                                   [--user-role-assignments]

範例

更新

az devcenter admin project-environment-type update --identity-type "UserAssigned" --user-assigned-identities "{"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1":{}}" --deployment-target-id "/subscriptions/00000000-0000-0000-0000-000000000000" --status "Enabled" --user-role-assignments "{"e45e3m7c-176e-416a-b466-0c5ec8298f8a":{"roles":{"4cbf0b6c-e750-441c-98a7-10da8387e4d6":{}}}}" --tags CostCenter="RnD" --environment-type-name "DevTest" --project-name "ContosoProj" --resource-group "rg1"

選擇性參數

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value、string 或 JSON 字串>。

--deployment-target-id

將對應環境類型之訂用帳戶的標識碼。 環境的資源將會部署到此訂用帳戶。

--display-name

項目環境類型的顯示名稱。

--environment-type-name --name -n

環境類型的名稱。

--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--identity-type

受控服務識別的類型(允許 SystemAssigned 和 UserAssigned 類型)。

接受的值: None, SystemAssigned, SystemAssigned, UserAssigned, UserAssigned
--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--project --project-name

專案的名稱。 使用 az configure -d project=<project_name> 來設定預設值。

--remove

從清單中移除屬性或專案。 範例:--remove property.list OR --remove 屬性ToRemove。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--roles

要指派給環境建立者的角色對應。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=。

--status

定義此環境類型是否可用於此專案。

接受的值: Disabled, Enabled
--subscription

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

--tags

資源標籤。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--user-assigned-identities -u

與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中的空白物件 ({})。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--user-role-assignments

在環境備份資源上建立的角色指派。 這是從用戶物件識別碼到角色定義標識元對象的對應。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

全域參數
--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 來取得完整偵錯記錄。