Azure Resource Lookup
MicrosoftOfficialCreated by Microsoft
- Skill
- Tool integration
- Cloud and DevOps
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Azure Resource Lookup provides a mechanism to list, find, and inventory Azure resources by leveraging Azure Resource Graph (ARG). It is designed to handle complex, cross-subscription queries that standard resource-specific tools cannot perform. By utilizing Kusto Query Language (KQL), users can perform deep discovery, identify orphaned resources, audit tag compliance, and generate resource inventories across their entire Azure environment.
What it does
- Executes cross-subscription resource discovery using Azure Resource Graph.
- Generates KQL queries to filter and aggregate resource metadata.
- Identifies orphaned resources such as unattached disks or unused network interfaces.
- Performs tag analysis and compliance auditing across resource types.
- Provides inventory reporting for resources grouped by type, location, or subscription.
- Integrates with CLI tools to format and display query results in tables.
When to use it
- When you need to list resources across multiple subscriptions simultaneously.
- When dedicated resource-specific tools lack the necessary listing or discovery capabilities.
- When performing audits for missing tags or specific resource configurations.
- When searching for orphaned or idle infrastructure components.
- When you need to answer broad questions like 'what resources do I have?'.
Advantages
- Fast, near real-time querying across large-scale Azure environments.
- Enables complex filtering and aggregation that standard CLI commands cannot handle.
- Provides a unified interface for cross-cutting resource discovery.
- Supports advanced KQL patterns for deep data analysis and reporting.
Usage examples
- “List all virtual machines in my subscription.”
- The agent generates and executes an ARG query to return a table of all VM resources, including their names, resource groups, and locations.
- “Find all unattached managed disks.”
- The agent runs a KQL query against the Resources table to identify disks where the managedBy property is empty, returning a list of orphaned disks.
- “Show me all resources missing the Environment tag.”
- The agent executes a query to filter resources where the Environment tag is null, providing a report of non-compliant resources.
- “Count my resources by type.”
- The agent performs a summary aggregation on the Resources table to provide a count of all resource types present in the environment.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/microsoft/azure-resource-lookup/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip azure-resource-lookup.zip -d .agents/skills
Documentation by Microsoft
Azure Resource Lookup
List, find, and discover Azure resources of any type across subscriptions and resource groups. Use Azure Resource Graph (ARG) for fast, cross-cutting queries when dedicated MCP tools don't cover the resource type.
When to Use This Skill
Use this skill when the user wants to:
List resources of any type (VMs, web apps, storage accounts, container apps, databases, etc.)
Show resources in a specific subscription or resource group
Query resources across multiple subscriptions or resource types
Find orphaned resources (unattached disks, unused NICs, idle IPs)
Discover resources missing required tags or configurations
Get a resource inventory spanning multiple types
Find resources in a specific state (unhealthy, failed provisioning, stopped)
Answer "what resources do I have?" or "show me my Azure resources"
List web apps, websites, or App Services
⚠️ Warning: App Service / Web Apps have no dedicated MCP
listcommand. Prompts like "list websites", "list web apps", or "list app services" must route through this skill to use Azure Resource Graph.
💡 Tip: For single-resource-type queries, first check if a dedicated MCP tool can handle it (see routing table below). If none exists, use Azure Resource Graph.
Quick Reference
| Property | Value |
|---|---|
| Query Language | KQL (Kusto Query Language subset) |
| CLI Command | az graph query -q "<KQL>" -o table |
| Extension | az extension add --name resource-graph |
| MCP Tool | extension_cli_generate with intent for az graph query |
| Best For | Cross-subscription queries, orphaned resources, tag audits |
MCP Tools
| Tool | Purpose | When to Use |
|---|---|---|
extension_cli_generate | Generate az graph query commands | Primary tool — generate ARG queries from user intent |
mcp_azure_mcp_subscription_list | List available subscriptions | Discover subscription scope before querying |
mcp_azure_mcp_group_list | List resource groups | Narrow query scope |
Workflow
Step 1: Check for a Dedicated MCP Tool
For single-resource-type queries, check if a dedicated MCP tool can handle it:
| Resource Type | MCP Tool | Coverage |
|---|---|---|
| Virtual Machines | compute | ✅ Full — list, details, sizes |
| Storage Accounts | storage | ✅ Full — accounts, blobs, tables |
| Cosmos DB | cosmos | ✅ Full — accounts, databases, queries |
| Key Vault | keyvault | ⚠️ Partial — secrets/keys only, no vault listing |
| SQL Databases | sql | ⚠️ Partial — requires resource group name |
| Container Registries | acr | ✅ Full — list registries |
| Kubernetes (AKS) | aks | ✅ Full — clusters, node pools |
| App Service / Web Apps | appservice | ❌ No list command — use ARG |
| Container Apps | — | ❌ No MCP tool — use ARG |
| Event Hubs | eventhubs | ✅ Full — namespaces, hubs |
| Service Bus | servicebus | ✅ Full — queues, topics |
If a dedicated tool is available with full coverage, use it. Otherwise proceed to Step 2.
Step 2: Generate the ARG Query
Use extension_cli_generate to build the az graph query command:
mcp_azure_mcp_extension_cli_generate
intent: "query Azure Resource Graph to <user's request>"
cli-type: "az"See Azure Resource Graph Query Patterns for common KQL patterns.
Step 3: Execute and Format Results
Run the generated command. Use --query (JMESPath) to shape output:
az graph query -q "<KQL>" --query "data[].{name:name, type:type, rg:resourceGroup}" -o tableUse --first N to limit results. Use --subscriptions to scope.
Error Handling
| Error | Cause | Fix |
|---|---|---|
resource-graph extension not found | Extension not installed | az extension add --name resource-graph |
AuthorizationFailed | No read access to subscription | Check RBAC — need Reader role |
BadRequest on query | Invalid KQL syntax | Verify table/column names; use =~ for case-insensitive type matching |
| Empty results | No matching resources or wrong scope | Check --subscriptions flag; verify resource type spelling |
Constraints
✅ Always use
=~for case-insensitive type matching (types are lowercase)✅ Always scope queries with
--subscriptionsor--firstfor large tenants✅ Prefer dedicated MCP tools for single-resource-type queries
❌ Never use ARG for real-time monitoring (data has slight delay)
❌ Never attempt mutations through ARG (read-only)
Files
- ATTRIBUTION.mdAdded by AutoGineer995 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md5.4 KiB
- references/azure-resource-graph.md4.9 KiB
references/azure-resource-graph.md
Azure Resource Graph Query Patterns
Azure Resource Graph (ARG) queries use a KQL subset against indexed Azure resource metadata. Results are near real-time across all subscriptions.
Command Format
az graph query -q "<KQL>" --query "data[].{col1:field1, col2:field2}" -o table| Flag | Purpose |
|---|---|
-q | KQL query string |
--query | JMESPath to shape output columns |
--first N | Limit to N results |
--subscriptions | Scope to specific subscription IDs |
-o table | Table output (also: json, tsv) |
Key Tables
| Table | Contents |
|---|---|
Resources | All ARM resources — name, type, location, properties, tags, sku |
ResourceContainers | Subscriptions, resource groups, management groups |
HealthResources | Resource health availability status |
ServiceHealthResources | Azure service health events/incidents |
AuthorizationResources | Role assignments and definitions |
AdvisorResources | Azure Advisor recommendations |
KQL Essentials
=~case-insensitive equals (use fortypefield — types are lowercase)properties.fieldNamenavigates the properties JSON bagmv-expandflattens arrays (subnets, IP configs)isempty()/isnotnull()checks for null/empty fieldstostring()converts dynamic fields for display
Resource Inventory Patterns
Count all resources by type:
Resources | summarize count() by type | order by count_ descInventory by type and location:
Resources | summarize count() by type, location | order by type ascCross-subscription inventory with subscription names:
Resources
| join kind=leftouter (
ResourceContainers
| where type == 'microsoft.resources/subscriptions'
| project subscriptionId, subscriptionName=name
) on subscriptionId
| summarize count() by subscriptionName, type
| order by subscriptionName asc, count_ descAll resources in a resource group:
Resources
| where resourceGroup =~ '<rg-name>'
| project name, type, location, sku.name, kindOrphaned Resource Patterns
Unattached managed disks:
Resources
| where type =~ 'microsoft.compute/disks'
| where isempty(managedBy)
| project name, resourceGroup, location, diskSizeGb=properties.diskSizeGB, sku=sku.nameUnused public IP addresses:
Resources
| where type =~ 'microsoft.network/publicipaddresses'
| where isempty(properties.ipConfiguration)
| project name, resourceGroup, location, sku=sku.nameOrphaned network interfaces:
Resources
| where type =~ 'microsoft.network/networkinterfaces'
| where isempty(properties.virtualMachine)
| project name, resourceGroup, locationIdle load balancers (no backends):
Resources
| where type =~ 'microsoft.network/loadbalancers'
| where array_length(properties.backendAddressPools) == 0
| project name, resourceGroup, locationTag & Compliance Patterns
Resources missing a required tag:
Resources
| where isnull(tags['Environment']) or isnull(tags['CostCenter'])
| project name, type, resourceGroup, tagsTag coverage analysis by type:
Resources
| extend hasTag = isnotnull(tags['Environment'])
| summarize total=count(), tagged=countif(hasTag) by type
| extend coverage=round(100.0 * tagged / total, 1)
| order by coverage ascResources with public network access:
Resources
| where properties.publicNetworkAccess =~ 'Enabled'
| project name, type, resourceGroup, locationHealth & Diagnostics Patterns
Resource health status:
HealthResources
| where type =~ 'microsoft.resourcehealth/availabilitystatuses'
| where properties.availabilityState != 'Available'
| project name, state=properties.availabilityState, reason=properties.reasonTypeActive service health incidents:
ServiceHealthResources
| where type =~ 'microsoft.resourcehealth/events'
| where properties.Status == 'Active'
| project name, title=properties.Title, status=properties.StatusFailed provisioning states:
Resources
| where properties.provisioningState != 'Succeeded'
| project name, type, resourceGroup, state=properties.provisioningStateService-Specific Patterns
App Services and their plans:
Resources
| where type =~ 'microsoft.web/sites'
| project name, kind, location, plan=properties.serverFarmId, state=properties.state, resourceGroupContainer Apps:
Resources
| where type =~ 'microsoft.app/containerapps'
| project name, location, provisioningState=properties.provisioningState, resourceGroupVNet and subnet discovery:
Resources
| where type =~ 'microsoft.network/virtualnetworks'
| mv-expand subnet=properties.subnets
| project vnetName=name, subnetName=subnet.name, prefix=subnet.properties.addressPrefixAdvisor cost recommendations:
AdvisorResources
| where properties.category == 'Cost'
| project name, impact=properties.impact, solution=properties.shortDescription.solutionRequirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs a command-line tool, Needs Node.js
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Microsoft
- Publisher
- Microsoft (Official)
- Source
- microsoft/skills · .github/plugins/azure-skills/skills/azure-resource-lookup · commit 0696600
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from .github/plugins/azure-skills/LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Also distributed in
- microsoft/azure-skills
AutoGineer is not affiliated with or endorsed by Microsoft or Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download azure-resource-lookup.zip