az policy assignment

リソース ポリシーの割り当てを管理します。

コマンド

名前 説明 Status
az policy assignment create

リソース ポリシーの割り当てを作成します。

コア GA
az policy assignment delete

リソース ポリシーの割り当てを削除します。

コア GA
az policy assignment identity

ポリシー割り当てのマネージド ID を管理します。

コア GA
az policy assignment identity assign

システム割り当て ID またはユーザー割り当て ID をポリシー割り当てに追加します。

コア GA
az policy assignment identity remove

ポリシー割り当てからマネージド ID を削除します。

コア GA
az policy assignment identity show

ポリシー割り当てのマネージド ID を表示します。

コア GA
az policy assignment list

リソース ポリシーの割り当てを一覧表示します。

コア GA
az policy assignment non-compliance-message

ポリシー割り当てのコンプライアンス違反メッセージを管理します。

コア GA
az policy assignment non-compliance-message create

ポリシーの割り当てにコンプライアンス違反メッセージを追加します。

コア GA
az policy assignment non-compliance-message delete

ポリシー割り当てから 1 つ以上のコンプライアンス違反メッセージを削除します。

コア GA
az policy assignment non-compliance-message list

ポリシー割り当てのコンプライアンス違反メッセージを一覧表示します。

コア GA
az policy assignment show

リソース ポリシーの割り当てを表示します。

コア GA
az policy assignment update

リソース ポリシーの割り当てを更新します。

コア GA

az policy assignment create

リソース ポリシーの割り当てを作成します。

az policy assignment create [--description]
                            [--display-name]
                            [--enforcement-mode {Default, DoNotEnforce}]
                            [--identity-scope]
                            [--location]
                            [--mi-system-assigned]
                            [--mi-user-assigned]
                            [--name]
                            [--not-scopes]
                            [--params]
                            [--policy]
                            [--policy-set-definition]
                            [--resource-group]
                            [--role]
                            [--scope]

スコープでリソース ポリシーの割り当てを作成する

Valid scopes are management group, subscription, resource group, and resource, for example
   management group:  /providers/Microsoft.Management/managementGroups/MyManagementGroup
   subscription:      /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333
   resource group:    /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup
   resource:          /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM
     az policy assignment create --scope \
        "/providers/Microsoft.Management/managementGroups/MyManagementGroup" \
            --policy {PolicyName} -p "{ \"allowedLocations\": \
                { \"value\": [ \"australiaeast\", \"eastus\", \"japaneast\" ] } }"

リソース ポリシーの割り当てを作成し、ルール のパラメーター値を指定します。

az policy assignment create --policy {PolicyName} -p "{ \"allowedLocations\": \
    { \"value\": [ \"australiaeast\", \"eastus\", \"japaneast\" ] } }"

システム割り当て ID を使用してリソース ポリシーの割り当てを作成します。

az policy assignment create --name myPolicy --policy {PolicyName} --mi-system-assigned --location eastus

システム割り当て ID を使用してリソース ポリシーの割り当てを作成します。 ID には、サブスクリプションへの "共同作成者" ロールアクセス権が付与されます。

az policy assignment create --name myPolicy --policy {PolicyName} --mi-system-assigned --identity-scope /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --role Contributor --location eastus

ユーザー割り当て ID を使用してリソース ポリシーの割り当てを作成します。

az policy assignment create --name myPolicy --policy {PolicyName} -g MyResourceGroup --mi-user-assigned myAssignedId --location westus

適用モードでリソース ポリシーの割り当てを作成します。 割り当ての作成と更新中にポリシー効果が適用されるかどうかを示します。 詳細については、 https://aka.ms/azure-policyAssignment-enforcement-mode にアクセスしてください。

az policy assignment create --name myPolicy --policy {PolicyName} --enforcement-mode 'DoNotEnforce'

省略可能のパラメーター

--description

ポリシー割り当ての説明。

--display-name

ポリシー割り当ての表示名。

--enforcement-mode -e

ポリシー割り当ての適用モード (既定、DoNotEnforce など)。 詳細については、 https://aka.ms/azure-policyAssignment-enforcement-mode にアクセスしてください。

承認された値: Default, DoNotEnforce
既定値: Default
--identity-scope

システム割り当て ID がアクセスできるスコープ。

--location -l

ポリシー割り当ての場所。 マネージド ID を使用する場合にのみ必要です。

--mi-system-assigned

ポリシー割り当てにシステム割り当て ID を使用するには、このフラグを指定します。 その他の例については、ヘルプを参照してください。

--mi-user-assigned

ポリシー割り当てに使用する UserAssigned ID。 その他の例については、ヘルプを参照してください。

--name -n

新しいポリシー割り当ての名前。

--not-scopes

ポリシー割り当てが適用されない領域区切りのスコープ。

--params -p

JSON 形式の文字列、またはポリシー規則のパラメーター値を持つファイルまたは URI へのパス。

--policy

ポリシー定義の名前または ID。 指定しない場合は、ポリシー セット定義パラメーターを指定する必要があります。

--policy-set-definition -d

ポリシー セット定義の名前または ID。 指定しない場合は、ポリシー定義パラメーターを指定する必要があります。

--resource-group -g

ポリシーが適用されるリソース グループ。

--role

マネージド ID に割り当てられるロール名または ID。

既定値: Contributor
--scope

このポリシー割り当てが適用されるスコープ。

グローバル パラメーター
--debug

すべてのデバッグ ログを表示するようにログの詳細レベルを上げます。

--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告は抑制します。

--output -o

出力形式。

承認された値: json, jsonc, none, table, tsv, yaml, yamlc
既定値: json
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ をご覧ください。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--verbose

ログの詳細レベルを上げます。 詳細なデバッグ ログを表示するには --debug を使います。

az policy assignment delete

リソース ポリシーの割り当てを削除します。

az policy assignment delete --name
                            [--resource-group]
                            [--scope]

リソース ポリシーの割り当てを削除します。 (自動生成)

az policy assignment delete --name MyPolicyAssignment

必須のパラメーター

--name -n

ポリシー割り当ての名前。

省略可能のパラメーター

--resource-group -g

ポリシーが適用されるリソース グループ。

--scope

このポリシー割り当てサブコマンドが適用されるスコープ。 既定値は現在のコンテキスト サブスクリプションです。

グローバル パラメーター
--debug

すべてのデバッグ ログを表示するようにログの詳細レベルを上げます。

--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告は抑制します。

--output -o

出力形式。

承認された値: json, jsonc, none, table, tsv, yaml, yamlc
既定値: json
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ をご覧ください。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--verbose

ログの詳細レベルを上げます。 詳細なデバッグ ログを表示するには --debug を使います。

az policy assignment list

リソース ポリシーの割り当てを一覧表示します。

az policy assignment list [--disable-scope-strict-match]
                          [--resource-group]
                          [--scope]

省略可能のパラメーター

--disable-scope-strict-match

親スコープまたは子スコープから継承されたポリシー割り当てを含めます。

--resource-group -g

ポリシーが適用されるリソース グループ。

--scope

このポリシー割り当てサブコマンドが適用されるスコープ。 既定値は現在のコンテキスト サブスクリプションです。

グローバル パラメーター
--debug

すべてのデバッグ ログを表示するようにログの詳細レベルを上げます。

--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告は抑制します。

--output -o

出力形式。

承認された値: json, jsonc, none, table, tsv, yaml, yamlc
既定値: json
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ をご覧ください。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--verbose

ログの詳細レベルを上げます。 詳細なデバッグ ログを表示するには --debug を使います。

az policy assignment show

リソース ポリシーの割り当てを表示します。

az policy assignment show --name
                          [--resource-group]
                          [--scope]

リソース ポリシーの割り当てを表示します。 (自動生成)

az policy assignment show --name MyPolicyAssignment

必須のパラメーター

--name -n

ポリシー割り当ての名前。

省略可能のパラメーター

--resource-group -g

ポリシーが適用されるリソース グループ。

--scope

このポリシー割り当てサブコマンドが適用されるスコープ。 既定値は現在のコンテキスト サブスクリプションです。

グローバル パラメーター
--debug

すべてのデバッグ ログを表示するようにログの詳細レベルを上げます。

--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告は抑制します。

--output -o

出力形式。

承認された値: json, jsonc, none, table, tsv, yaml, yamlc
既定値: json
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ をご覧ください。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--verbose

ログの詳細レベルを上げます。 詳細なデバッグ ログを表示するには --debug を使います。

az policy assignment update

リソース ポリシーの割り当てを更新します。

az policy assignment update [--description]
                            [--display-name]
                            [--enforcement-mode {Default, DoNotEnforce}]
                            [--name]
                            [--not-scopes]
                            [--params]
                            [--resource-group]
                            [--scope]

リソース ポリシーの割り当ての説明を更新します。

az policy assignment update --name myPolicy --description 'My policy description'

省略可能のパラメーター

--description

ポリシー割り当ての説明。

--display-name

ポリシー割り当ての表示名。

--enforcement-mode -e

ポリシー割り当ての適用モード (既定、DoNotEnforce など)。 詳細については、 https://aka.ms/azure-policyAssignment-enforcement-mode にアクセスしてください。

承認された値: Default, DoNotEnforce
--name -n

ポリシー割り当ての名前。

--not-scopes

ポリシー割り当てが適用されない領域区切りのスコープ。

--params -p

JSON 形式の文字列、またはポリシー規則のパラメーター値を持つファイルまたは URI へのパス。

--resource-group -g

ポリシーが適用されるリソース グループ。

--scope

このポリシー割り当てサブコマンドが適用されるスコープ。 既定値は現在のコンテキスト サブスクリプションです。

グローバル パラメーター
--debug

すべてのデバッグ ログを表示するようにログの詳細レベルを上げます。

--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告は抑制します。

--output -o

出力形式。

承認された値: json, jsonc, none, table, tsv, yaml, yamlc
既定値: json
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ をご覧ください。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--verbose

ログの詳細レベルを上げます。 詳細なデバッグ ログを表示するには --debug を使います。