az blueprint assignment
Note
此參考是 Azure CLI 藍圖延伸模組 的一部分(2.50.0 版或更高版本)。 擴充功能會在您第一次執行 az blueprint assignment 命令時自動安裝。 深入了解擴充功能。
此命令群組已隱含取代,因為命令群組 'az blueprint' 已被取代,未來版本將會移除。 藍圖和相關聯的命令最早將於 2026 年 7 月淘汰。 建議客戶在該日期之後轉移至範本規範和部署堆疊,以支援其應用場景。 遷移文件可以在 https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/migrate-blueprint取得。
管理藍圖指派的命令。
命令
| 名稱 | Description | 類型 | 狀態 |
|---|---|---|---|
| az blueprint assignment create |
建立藍圖指派。 |
Extension | GA |
| az blueprint assignment delete |
刪除藍圖指派。 |
Extension | Preview |
| az blueprint assignment list |
列出訂用帳戶內的藍圖指派。 |
Extension | Preview |
| az blueprint assignment show |
取得藍圖指派。 |
Extension | Preview |
| az blueprint assignment update |
更新藍圖指派。 |
Extension | GA |
| az blueprint assignment wait |
將 CLI 置於等候狀態,直到符合藍圖指派的條件為止。 |
Extension | GA |
| az blueprint assignment who |
取得藍圖 Servie 主體名稱 objectId。 |
Extension | Preview |
az blueprint assignment create
此命令已隱含取代,因為命令群組 'az blueprint' 已被取代,且將在未來的版本中移除。 藍圖和相關聯的命令最早將於 2026 年 7 月淘汰。 建議客戶在該日期之後轉移至範本規範和部署堆疊,以支援其應用場景。 遷移文件可以在 https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/migrate-blueprint取得。
建立藍圖指派。
az blueprint assignment create --name
[--blueprint-version]
[--description]
[--display-name]
[--identity-type {None, SystemAssigned, UserAssigned}]
[--location]
[--locks-excluded-principals]
[--locks-mode {AllResourcesDoNotDelete, AllResourcesReadOnly, None}]
[--management-group]
[--parameters]
[--resource-group-value]
[--subscription]
[--user-assigned-identity]
範例
使用系統指派的受控識別指派
az blueprint assignment create --subscription MySubscription --name \
MyBlueprintAssignment --location eastus --identity-type SystemAssigned \
--description "Enforce pre-defined MyBlueprint to this subscription." \
--blueprint-version "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/provid \
ers/Microsoft.Blueprint/blueprints/MyBlueprint/versions/v2" \
--resource-group-value artifact_name=rg-art-1 name=rg1 location=westus \
--resource-group-value artifact_name=rg-art-2 name=rg2 location=eastus \
--parameters "path/to/parameter/file" \
使用使用者指派的受控識別指派
az blueprint assignment create --subscription MySubscription --name \
MyBlueprintAssignment --location eastus --identity-type UserAssigned \
--user-assigned-identity "/subscriptions/00000000-0000-0000-0000-000000000000 \
/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"\
--description "Enforce pre-defined MyBlueprint to this subscription." \
--blueprint-version "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup \
/providers/Microsoft.Blueprint/blueprints/MyBlueprint/versions/v2" \
--resource-group-value artifact_name=rg-art-1 name=rg1 location=eastus \
--parameters "path/to/parameter/file" \
必要參數
藍圖指派的名稱。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
藍圖定義的已發佈版本資源標識碼。
多行說明此資源。
單行字串說明此資源。
受控識別的類型。
| 屬性 | 值 |
|---|---|
| 參數群組: | Identity Arguments |
| 預設值: | SystemAssigned |
| 接受的值: | None, SystemAssigned, UserAssigned |
Location. 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。
從藍圖鎖定排除的 AAD 主體清單。 最多允許5個主體。
鎖定模式。
| 屬性 | 值 |
|---|---|
| 接受的值: | AllResourcesDoNotDelete, AllResourcesReadOnly, None |
針對藍圖指派的目標範圍使用管理群組。 它保留供日後使用。 請改用 --subscription。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
藍圖指派參數值。 它可以是 JSON 字串或 JSON 檔案路徑。
資源群組的索引鍵=值組。 索引鍵包括 『artifact_name』(必要)、』name『location』。
針對藍圖指派的目標範圍使用訂用帳戶。 如果未指定選項,則會使用預設susbcription。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
與資源相關聯的使用者指派受控識別。
| 屬性 | 值 |
|---|---|
| 參數群組: | Identity Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az blueprint assignment delete
此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus
此命令已隱含取代,因為命令群組 'az blueprint' 已被取代,且將在未來的版本中移除。 藍圖和相關聯的命令最早將於 2026 年 7 月淘汰。 建議客戶在該日期之後轉移至範本規範和部署堆疊,以支援其應用場景。 遷移文件可以在 https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/migrate-blueprint取得。
刪除藍圖指派。
az blueprint assignment delete --name
[--delete-behavior {all, none}]
[--management-group]
[--subscription]
[--yes]
範例
刪除指派
az blueprint assignment delete --subscription MySubscription --name MyBlueprintAssignment
必要參數
藍圖指派的名稱。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
當 deleteBehavior=all 時,將會刪除藍圖指派所建立的資源。
| 屬性 | 值 |
|---|---|
| 接受的值: | all, none |
針對藍圖的範圍使用管理群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
針對藍圖的範圍使用訂用帳戶。 如果未指定 --management-group,則會使用 --subscription 值或預設訂用帳戶作為範圍。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
請勿提示確認。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az blueprint assignment list
此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus
此命令已隱含取代,因為命令群組 'az blueprint' 已被取代,且將在未來的版本中移除。 藍圖和相關聯的命令最早將於 2026 年 7 月淘汰。 建議客戶在該日期之後轉移至範本規範和部署堆疊,以支援其應用場景。 遷移文件可以在 https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/migrate-blueprint取得。
列出訂用帳戶內的藍圖指派。
az blueprint assignment list [--management-group]
[--max-items]
[--next-token]
[--subscription]
範例
清單指派
az blueprint assignment list --subscription MySubscription
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
針對藍圖的範圍使用管理群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
命令輸出中要傳回的項目總數。 如果可用的專案總數超過指定的值,則會在命令的輸出中提供令牌。 若要繼續分頁,請在後續命令的 --next-token 自變數中提供令牌值。
| 屬性 | 值 |
|---|---|
| 參數群組: | Pagination Arguments |
標記,指定要開始分頁的位置。 這是先前截斷回應中的令牌值。
| 屬性 | 值 |
|---|---|
| 參數群組: | Pagination Arguments |
針對藍圖的範圍使用訂用帳戶。 如果未指定 --management-group,則會使用 --subscription 值或預設訂用帳戶作為範圍。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az blueprint assignment show
此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus
此命令已隱含取代,因為命令群組 'az blueprint' 已被取代,且將在未來的版本中移除。 藍圖和相關聯的命令最早將於 2026 年 7 月淘汰。 建議客戶在該日期之後轉移至範本規範和部署堆疊,以支援其應用場景。 遷移文件可以在 https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/migrate-blueprint取得。
取得藍圖指派。
az blueprint assignment show --name
[--management-group]
[--subscription]
範例
顯示指派
az blueprint assignment show --subscription MySubscription --name MyBlueprintAssignment
必要參數
藍圖指派的名稱。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
針對藍圖的範圍使用管理群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
針對藍圖的範圍使用訂用帳戶。 如果未指定 --management-group,則會使用 --subscription 值或預設訂用帳戶作為範圍。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az blueprint assignment update
此命令已隱含取代,因為命令群組 'az blueprint' 已被取代,且將在未來的版本中移除。 藍圖和相關聯的命令最早將於 2026 年 7 月淘汰。 建議客戶在該日期之後轉移至範本規範和部署堆疊,以支援其應用場景。 遷移文件可以在 https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/migrate-blueprint取得。
更新藍圖指派。
az blueprint assignment update --name
[--blueprint-version]
[--description]
[--display-name]
[--identity-type {None, SystemAssigned, UserAssigned}]
[--location]
[--locks-excluded-principals]
[--locks-mode {AllResourcesDoNotDelete, AllResourcesReadOnly, None}]
[--management-group]
[--parameters]
[--resource-group-value]
[--subscription]
[--user-assigned-identity]
必要參數
藍圖指派的名稱。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
藍圖定義的已發佈版本資源標識碼。
多行說明此資源。
單行字串說明此資源。
受控識別的類型。
| 屬性 | 值 |
|---|---|
| 參數群組: | Identity Arguments |
| 接受的值: | None, SystemAssigned, UserAssigned |
Location. 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。
從藍圖鎖定排除的 AAD 主體清單。 最多允許5個主體。
鎖定模式。
| 屬性 | 值 |
|---|---|
| 接受的值: | AllResourcesDoNotDelete, AllResourcesReadOnly, None |
針對藍圖指派的目標範圍使用管理群組。 它保留供日後使用。 請改用 --subscription。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
藍圖指派參數值。 它可以是 JSON 字串或 JSON 檔案路徑。
資源群組的索引鍵=值組。 索引鍵包括 『artifact_name』(必要)、』name『location』。
針對藍圖指派的目標範圍使用訂用帳戶。 如果未指定選項,則會使用預設susbcription。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
與資源相關聯的使用者指派受控識別。
| 屬性 | 值 |
|---|---|
| 參數群組: | Identity Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az blueprint assignment wait
此命令已隱含取代,因為命令群組 'az blueprint' 已被取代,且將在未來的版本中移除。 藍圖和相關聯的命令最早將於 2026 年 7 月淘汰。 建議客戶在該日期之後轉移至範本規範和部署堆疊,以支援其應用場景。 遷移文件可以在 https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/migrate-blueprint取得。
將 CLI 置於等候狀態,直到符合藍圖指派的條件為止。
az blueprint assignment wait --name
[--created]
[--custom]
[--deleted]
[--exists]
[--interval]
[--management-group]
[--subscription]
[--timeout]
[--updated]
範例
暫停執行下一行 CLI 腳本,直到藍圖指派成功布建為止。
az blueprint assignment wait --subscription MySubscription \ --name MyBlueprintAssignment --created
必要參數
藍圖指派的名稱。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
請等候在 'Succeeded' 使用 'provisioningState' 建立。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
等到條件符合自定義 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
等到刪除為止。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
等候資源存在。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
輪詢間隔以秒為單位。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | 30 |
針對藍圖指派的目標範圍使用管理群組。 它保留供日後使用。 請改用 --subscription。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
針對藍圖指派的目標範圍使用訂用帳戶。 如果未指定選項,則會使用預設susbcription。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
以秒為單位的等候上限。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | 3600 |
等到 provisioningState 更新為 'Succeeded'。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az blueprint assignment who
此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus
此命令已隱含取代,因為命令群組 'az blueprint' 已被取代,且將在未來的版本中移除。 藍圖和相關聯的命令最早將於 2026 年 7 月淘汰。 建議客戶在該日期之後轉移至範本規範和部署堆疊,以支援其應用場景。 遷移文件可以在 https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/migrate-blueprint取得。
取得藍圖 Servie 主體名稱 objectId。
az blueprint assignment who --name
[--management-group]
[--subscription]
範例
取得 SPN objectId
az blueprint assignment who --subscription MySubscription --name MyBlueprintAssignment
必要參數
藍圖指派的名稱。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
針對藍圖的範圍使用管理群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
針對藍圖的範圍使用訂用帳戶。 如果未指定 --management-group,則會使用 --subscription 值或預設訂用帳戶作為範圍。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource_scope Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |