特定のユーザーのロールの割り当てを一覧表示するには、az role assignment list を使用します。
az role assignment list --assignee {assignee}
By default, only role assignments for the current subscription will be displayed. To view role assignments for the current subscription and below, add the --all
parameter. To include role assignments at parent scopes, add the --include-inherited
parameter. To include role assignments for groups of which the user is a member transitively, add the --include-groups
parameter.
The following example lists the role assignments that are assigned directly to the patlong@contoso.com user:
az role assignment list --all --assignee patlong@contoso.com --output json --query '[].{principalName:principalName, roleDefinitionName:roleDefinitionName, scope:scope}'
[
{
"principalName": "patlong@contoso.com",
"roleDefinitionName": "Backup Operator",
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/pharma-sales"
},
{
"principalName": "patlong@contoso.com",
"roleDefinitionName": "Virtual Machine Contributor",
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/pharma-sales"
}
]