Start with the problem you are investigating—not a blank query editor.
Find Azure resources before you make a change
Search read-only KQL queries for access, exposure, tags, diagnostics, backup, recent changes, and inventory. KQL (Kusto Query Language) lets you inspect Azure resources and configuration evidence across the Azure scope you can read.
Use one KQL query to review resources across accessible subscriptions and groups.
Interpret the KQL output, then open a related runbook, command, or study path.
KQL turns a scattered Azure estate into evidence you can review.
Azure resources are spread across subscriptions, resource groups, providers, and portals. This library gives you reusable Azure Resource Graph KQL so you can answer inventory and troubleshooting questions quickly before you change production. Nothing runs against your tenant from AzureGlossary; you copy the KQL and run it in your own Azure Resource Graph Explorer or Azure CLI session.
- 1Describe the questionSearch for “public IPs,” “missing owner tags,” “RBAC,” “backup,” or another outcome.
- 2Copy the KQLReview the table, scope, and fields before running the query.
- 3Run it in AzureUse Resource Graph Explorer or
az graph query -q "...". - 4Interpret before actingConfirm scope and open the related runbook before making a change.
Useful KQL you can copy immediately
These compact Azure Resource Graph KQL queries cover the first inventory and risk checks most people need.
where filter
project choose columns
extend create fields
summarize aggregate
order by sort
Resources
| summarize resourceCount = count() by type
| order by resourceCount desc
Resources
| where isempty(tostring(tags['owner']))
| project name, type, resourceGroup, subscriptionId, location
| order by type asc
Resources
| where type =~ 'microsoft.network/publicipaddresses'
| project name, resourceGroup, subscriptionId, location,
ipAddress = tostring(properties.ipAddress),
allocation = tostring(properties.publicIPAllocationMethod)
| order by name asc
AuthorizationResources
| where type =~ 'microsoft.authorization/roleassignments'
| extend principalType = tostring(properties.principalType),
principalId = tostring(properties.principalId),
roleDefinitionId = tostring(properties.roleDefinitionId)
| project assignmentResourceId = id, principalType, principalId,
roleDefinitionId, subscriptionId
| order by principalType asc
Resources
| where type =~ 'microsoft.compute/virtualmachines'
| project name, resourceGroup, location,
osType = tostring(properties.storageProfile.osDisk.osType),
vmSize = tostring(properties.hardwareProfile.vmSize)
| order by name asc
HealthResources
| where type =~ 'microsoft.resourcehealth/availabilitystatuses'
| summarize resourceCount = count()
by subscriptionId,
availabilityState = tostring(properties.availabilityState)
| order by subscriptionId asc
Resources
| distinct type, apiVersion
| where isnotnull(apiVersion)
| order by type asc
Resources
| where type =~ 'microsoft.storage/storageaccounts'
| project name, resourceGroup, location,
allowBlobPublicAccess = tobool(properties.allowBlobPublicAccess),
minimumTlsVersion = tostring(properties.minimumTlsVersion),
publicNetworkAccess = tostring(properties.publicNetworkAccess)
| order by name asc
Filter by area · KQL categories
Azure Resource Graph queries
Loading queries