Azure Resource Graph Queries for Resource Discovery
Azure Resource Graph (ARG) enables fast, cross-subscription resource querying using KQL via az graph query. Use it for bulk resource discovery and relationship mapping.
How to Query
Use the extension_cli_generate MCP tool to generate az graph query commands:
yaml
mcp_azure_mcp_extension_cli_generate
intent: "query Azure Resource Graph to <describe what you want to find>"
cli-type: "az"Or construct directly:
bash
az graph query -q "<KQL>" --query "data[].\{name:name, type:type\}" -o table⚠️ Prerequisite:
az extension add --name resource-graph
Key Tables
| Table | Contains |
|---|---|
Resources | All ARM resource instances (name, type, location, properties, tags) |
ResourceContainers | Subscriptions, resource groups, management groups |
Resource Discovery Patterns
List all resources by type:
kql
Resources | summarize count() by type | order by count_ descInventory by location and type:
kql
Resources | summarize count() by type, location | order by type ascList all resources in a resource group with details:
kql
Resources