az blueprint artifact policy

注意

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

管理藍圖原則指派成品的命令。

命令

名稱 Description 類型 狀態
az blueprint artifact policy create

建立藍圖原則成品。

擴充 GA
az blueprint artifact policy update

更新藍圖原則成品。

擴充 GA

az blueprint artifact policy create

建立藍圖原則成品。

az blueprint artifact policy create --artifact-name
                                    --blueprint-name
                                    --policy-definition-id
                                    [--depends-on]
                                    [--description]
                                    [--display-name]
                                    [--management-group]
                                    [--parameters]
                                    [--resource-group-art]
                                    [--subscription]

範例

建立原則成品

az blueprint artifact policy create \
--blueprint-name MyBlueprint --artifact-name MyPolicy --policy-definition-id \
"/providers/Microsoft.Authorization/policyDefinitions/00000000-0000-0000-0000-000000000000" \
--parameters path/to/file --display-name "Policy to do sth"

必要參數

--artifact-name

藍圖成品的名稱。

--blueprint-name

藍圖定義的名稱。

--policy-definition-id

完整原則定義識別碼。

選擇性參數

--depends-on

必須在指定成品之前部署的成品。

--description

藍圖成品的描述。

--display-name

這個成品的 DisplayName。

--management-group -m

針對藍圖的範圍使用管理群組。

--parameters -p

原則指派成品的參數。 它可以是 JSON 字串或 JSON 檔案路徑。

--resource-group-art

將指派原則的資源群組成品名稱。

--subscription -s

針對藍圖的範圍使用訂用帳戶。 如果未指定 --management-group,則會使用 --subscription 值或預設訂用帳戶作為範圍。

全域參數
--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 blueprint artifact policy update

更新藍圖原則成品。

az blueprint artifact policy update --artifact-name
                                    --blueprint-name
                                    [--depends-on]
                                    [--description]
                                    [--display-name]
                                    [--management-group]
                                    [--parameters]
                                    [--resource-group-art]
                                    [--subscription]

範例

更新原則成品

az blueprint artifact policy update \
--blueprint-name MyBlueprint --artifact-name MyPolicy --display-name "My Policy"

必要參數

--artifact-name

藍圖成品的名稱。

--blueprint-name

藍圖定義的名稱。

選擇性參數

--depends-on

必須在指定成品之前部署的成品。 使用不含任何值的 '--depends-on' 來移除相依性。

--description

藍圖成品的描述。

--display-name

這個成品的 DisplayName。

--management-group -m

針對藍圖的範圍使用管理群組。

--parameters -p

原則指派成品的參數。 它可以是 JSON 字串或 JSON 檔案路徑。

--resource-group-art

將指派原則的資源群組成品名稱。

--subscription -s

針對藍圖的範圍使用訂用帳戶。 如果未指定 --management-group,則會使用 --subscription 值或預設訂用帳戶作為範圍。

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