Score:1

Should type microsoft.authorization/roledefinitions be accessible through Azure Resource Graph

kh flag

Is type microsoft.authorization/roledefinitions available through Azure Resource Graph?

Context

I'm hoping to query Azure Resource Graph to fetch all roles which have specific permissions. Looking around I found microsoft.authorization/roledefinitions which seems to be a good starting point; it's documented here and is listed under tables in Azure Resource Graph Explorer / double clicking it adds the line | where type == "microsoft.authorization/roledefinitions" which seems promising.

However, when I run the below Kusto this type doesn't show up:

Search-AzGraph -query @'
resources 
| where type startswith "Microsoft.Aut" 
| distinct type
'@

The response is simply:

type
----
microsoft.automation/automationaccounts
microsoft.automation/automationaccounts/runbooks

I do have access to view role definitions though; as running Get-AzRoleDefinition produces a list of results.

Is there something more I need to do to make this type visible via Kusto; or is it simply not yet available through ARG?

Score:1
kr flag

you can change the table to authorizationresources and that should provide the definitions:

$query = 'authorizationresources | where type == "microsoft.authorization/roledefinitions"' 
Search-AzGraph -query $query -UseTenantScope 
kh flag
Ah - thank-you; I'd not even thought to question the table the resources would be under. That works perfectly.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.