To get the role definition name, you need to make separate REST API calls and then make a client-side connection.
If you start network capture while the Azure PowerShell or Azure CLI is running, directly accessing the REST API calls is simple.
Role List Assignment
GET https://management.azure.com/subscriptions/ {subscriptionId}/providers/Microsoft.Authorization/roleAssignments?api-version=2015-07-01
:
"value": [
{
"properties": {
"roleDefinitionId": "/subscriptions/<subscriptionId>/providers/Microsoft.Authorization/roleDefinitions/<roleDefinitionId>",
"principalId": "<principalId>",
"scope": "/subscriptions/<subscriptionId>",
"createdOn": "2017-02-03T07:55:59.6345664Z",
"updatedOn": "2017-02-03T07:55:59.6345664Z",
"createdBy": "7c728184-cd9e-47ad-b72f-e7ac40b80624",
"updatedBy": "7c728184-cd9e-47ad-b72f-e7ac40b80624"
},
"id": "/subscriptions/<subscriptionId>/providers/Microsoft.Authorization/roleAssignments/ea667734-e984-4726-bf0b-2116aaaedfde",
"type": "Microsoft.Authorization/roleAssignments",
"name": "ea667734-e984-4726-bf0b-2116aaaedfde"
},
GET https://management.azure.com/providers/Microsoft.Authorization/roleDefinitions? $filter = atScopeAndBelow() & api-version = 2015-07-01
:
{
"properties": {
"roleName": "Contributor",
"type": "BuiltInRole",
"description": "Lets you manage everything except access to resources.",
"assignableScopes": [
"/"
],
"permissions": [
{
"actions": [
"*"
],
"notActions": [
"Microsoft.Authorization/*/Delete",
"Microsoft.Authorization/*/Write",
"Microsoft.Authorization/elevateAccess/Action"
]
}
],
"createdOn": "0001-01-01T08:00:00.0000000Z",
"updatedOn": "2016-12-14T02:04:45.1393855Z",
"createdBy": null,
"updatedBy": null
},
"id": "/providers/Microsoft.Authorization/roleDefinitions/<roleDefinitionId>",
"type": "Microsoft.Authorization/roleDefinitions",
"name": "<roleDefinitionId>"
},
AAD -
POST https://graph.windows.net//getObjectsByObjectIds?api-version=1.6
{
"objectIds": [
"<objectId1>",
"<objectId2>",
...
],
"includeDirectoryObjectReferences": true
}