특정 사용자에 대한 역할 할당을 나열하려면 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"
}
]