Role Definitions - List

Get all role definitions that are applicable at scope and above.

GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions?api-version=2022-04-01
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions?$filter={$filter}&api-version=2022-04-01

URI Parameters

Name In Required Type Description
scope
path True

string

The scope of the role definition.

api-version
query True

string

The API version to use for this operation.

$filter
query

string

The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well.

Responses

Name Type Description
200 OK

RoleDefinitionListResult

OK - Returns an array of role definitions.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Permissions

To call this API, you must be assigned a role that has the following permissions. For more information, see Azure built-in roles.

Microsoft.Authorization/roleDefinitions/read

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

List role definitions for scope

Sample Request

GET https://management.azure.com/scope/providers/Microsoft.Authorization/roleDefinitions?api-version=2022-04-01

Sample Response

{
  "value": [
    {
      "properties": {
        "roleName": "Role name",
        "type": "roletype",
        "description": "Role description",
        "assignableScopes": [
          "/subscriptions/subId"
        ],
        "permissions": [
          {
            "actions": [
              "action"
            ],
            "notActions": [],
            "dataActions": [
              "dataAction"
            ],
            "notDataActions": []
          }
        ]
      },
      "id": "/subscriptions/subID/providers/Microsoft.Authorization/roleDefinitions/roleDefinitionId",
      "type": "Microsoft.Authorization/roleDefinitions",
      "name": "roleDefinitionId"
    }
  ]
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

Permission

Role definition permissions.

RoleDefinition

Role definition.

RoleDefinitionListResult

Role definition list operation result.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

Permission

Role definition permissions.

Name Type Description
actions

string[]

Allowed actions.

dataActions

string[]

Allowed Data actions.

notActions

string[]

Denied actions.

notDataActions

string[]

Denied Data actions.

RoleDefinition

Role definition.

Name Type Description
id

string

The role definition ID.

name

string

The role definition name.

properties.assignableScopes

string[]

Role definition assignable scopes.

properties.createdBy

string

Id of the user who created the assignment

properties.createdOn

string

Time it was created

properties.description

string

The role definition description.

properties.permissions

Permission[]

Role definition permissions.

properties.roleName

string

The role name.

properties.type

string

The role type.

properties.updatedBy

string

Id of the user who updated the assignment

properties.updatedOn

string

Time it was updated

type

string

The role definition type.

RoleDefinitionListResult

Role definition list operation result.

Name Type Description
nextLink

string

The URL to use for getting the next set of results.

value

RoleDefinition[]

Role definition list.