次の方法で共有


az policy assignment identity

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

コマンド

名前 説明 状態
az policy assignment identity assign

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

Core Deprecated
az policy assignment identity remove

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

Core Deprecated
az policy assignment identity show

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

Core GA

az policy assignment identity assign

非推奨

既存の ID の置き換えは、リソース コマンドの将来のリリースで変更されます。 最初に既存の ID を削除する必要があります。

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

az policy assignment identity assign --name
                                     [--identity-scope]
                                     [--resource-group]
                                     [--role]
                                     [--scope]
                                     [--system-assigned]
                                     [--user-assigned]

システム割り当てマネージド ID をポリシー割り当てに追加します。

az policy assignment identity assign --system-assigned -g MyResourceGroup -n MyPolicyAssignment

システム割り当てマネージド ID をポリシー割り当てに追加し、現在のリソース グループの "共同作成者" ロールを付与します。

az policy assignment identity assign --system-assigned -g MyResourceGroup -n MyPolicyAssignment --role Contributor --identity-scope /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyResourceGroup

ユーザー割り当てマネージド ID をポリシー割り当てに追加します。

az policy assignment identity assign --user-assigned MyAssignedId -g MyResourceGroup -n MyPolicyAssignment

必須のパラメーター

--name -n

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

省略可能のパラメーター

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--identity-scope

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

プロパティ
Parameter group: Managed Identity Arguments
--resource-group -g

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

--role

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

プロパティ
Parameter group: Managed Identity Arguments
規定値: Contributor
--scope

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

--system-assigned

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

プロパティ
Parameter group: Managed Identity Arguments
--user-assigned

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

プロパティ
Parameter group: Managed Identity Arguments
グローバル パラメーター
--debug

ログの詳細度を上げて、すべてのデバッグ ログを表示します。

プロパティ
規定値: False
--help -h

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

--only-show-errors

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

プロパティ
規定値: False
--output -o

Output format.

プロパティ
規定値: json
指定可能な値: json, jsonc, none, table, tsv, yaml, yamlc
--query

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

--subscription

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

--verbose

ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。

プロパティ
規定値: False

az policy assignment identity remove

非推奨

ユーザー割り当て ID の削除は、リソース コマンドの今後のリリースで変更されます。 ユーザー割り当てスイッチを提供する必要があります。

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

az policy assignment identity remove --name
                                     [--resource-group]
                                     [--scope]

必須のパラメーター

--name -n

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

省略可能のパラメーター

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--resource-group -g

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

--scope

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

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

ログの詳細度を上げて、すべてのデバッグ ログを表示します。

プロパティ
規定値: False
--help -h

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

--only-show-errors

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

プロパティ
規定値: False
--output -o

Output format.

プロパティ
規定値: json
指定可能な値: json, jsonc, none, table, tsv, yaml, yamlc
--query

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

--subscription

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

--verbose

ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。

プロパティ
規定値: False

az policy assignment identity show

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

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

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

az policy assignment identity show --name MyPolicyAssignment --scope '/providers/Microsoft.Management/managementGroups/MyManagementGroup'

必須のパラメーター

--name -n

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

省略可能のパラメーター

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--resource-group -g

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

--scope

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

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

ログの詳細度を上げて、すべてのデバッグ ログを表示します。

プロパティ
規定値: False
--help -h

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

--only-show-errors

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

プロパティ
規定値: False
--output -o

Output format.

プロパティ
規定値: json
指定可能な値: json, jsonc, none, table, tsv, yaml, yamlc
--query

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

--subscription

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

--verbose

ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。

プロパティ
規定値: False