Welcome to Azure Resource Graph
Azure Resource Graph is a service in Azure that is designed to extend Azure Resource Management by providing efficient and performance resource exploration with the ability to query at scale across a given set of subscriptions so that you can effectively govern your environment. Azure Resource Graph enables full visibility into your environments by providing high performance and powerful query capability across all your resources.
From here you can experience the power of Azure Resource Graph by doing it yourself.
You can use Microsoft Azure Resource Graph with different language support like :
- With Azure CLI
- With PowerShell
- With Kusto in Azure Resource Graph Explorer
Start here when you like to work with Microsoft Azure CLI
From here we are going further with Azure PowerShell and Azure Resource Graph in CloudShell.
Login to https://shell.azure.com
Type following command : Install-Module -Name Az.ResourceGraph
Type the Following Command: Get-Command -Module ‘Az.ResourceGraph’ -CommandType ‘Cmdlet’
From here we can start with Search in Azure Resource Graph
The first step to understanding queries with Azure Resource Graph is a basic understanding of the Query Language. If you aren’t already familiar with Azure Data Explorer, it’s recommended to review the basics to understand how to compose requests for the resources you’re looking for.
Without the Limit 5 you get all of your resources.
Command: Search-AzGraph -Query ‘Resources | project name, type | limit 10 | order by name asc’
Command: Search-AzGraph -Query “Resources | summarize count()”
Command: Search-AzGraph -Query “Resources | where type =~ ‘Microsoft.Compute/virtualMachines’ | project name, properties.storageProfile.osDisk.osType | top 15 by name desc”
Handy to see your External IP Addresses in Azure 😉
To find tour Tagged Resources in Azure.
Here you can make your kusto queries and save them for Colleagues by sharing them.
| where type =~ ‘microsoft.compute/virtualmachines’
| extend nics=array_length(properties.networkProfile.networkInterfaces)
| mv-expand nic=properties.networkProfile.networkInterfaces
| where nics == 1 or nic.properties.primary =~ ‘true’ or isempty(nic)
| project vmId = id, vmName = name, vmSize=tostring(properties.hardwareProfile.vmSize), nicId = tostring(nic.id)
| join kind=leftouter (
| where type =~ ‘microsoft.network/networkinterfaces’
| extend ipConfigsCount=array_length(properties.ipConfigurations)
| mv-expand ipconfig=properties.ipConfigurations
| where ipConfigsCount == 1 or ipconfig.properties.primary =~ ‘true’
| project nicId = id, publicIpId = tostring(ipconfig.properties.publicIPAddress.id))
| project-away nicId1
| summarize by vmId, vmName, vmSize, nicId, publicIpId
| join kind=leftouter (
| where type =~ ‘microsoft.network/publicipaddresses’
| project publicIpId = id, publicIpAddress = properties.ipAddress)
| project-away publicIpId1
More information about Microsoft Azure Resource Graph Explorer
When you are the Microsoft Azure Administrator, the Resource Graph Explorer can be really Powerful and fast to get the right information you are looking for. When you invest in the kusto queries your can save them and Share with your Colleagues to serve your business needs. Hope this is useful for you and happy Scripting with Kusto, Powershell or Azure CLI in the Cloud