Skip to content

az role definition list cannot show only built-in roles #30647

@jiasli

Description

@jiasli

Related command
az role definition list

Is your feature request related to a problem? Please describe.
According to https://learn.microsoft.com/en-us/azure/role-based-access-control/role-definitions-list#list-role-definitions, the underlying Role Definitions - List REST API supports returning

  1. CustomRole + BuiltInRole
  2. only CustomRole
  3. only BuiltInRole

But in CLI, --custom-role-only only supports returning

  1. CustomRole + BuiltInRole
  2. only CustomRole

if custom_role_only:
roles = [r for r in roles if worker.get_role_property(r, 'role_type') == 'CustomRole']

thus losing the ability to only show BuiltInRole.

Describe the solution you'd like
az role definition list should support a --type argument that maps to the $filter=type+eq+'{type}' filter.

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamRBACaz rolequestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions