🔥 Make sure you star the repo to keep up to date with new tips and tricks.
💡 Learn more : Azure Resource Graph.
📺 Watch the video : Write queries and create dashboards using the full power of Azure Resource Graph.
Sometimes, it is difficult to gain insights into your cloud resources. Especially when they are scattered across many Azure subscriptions. Azure Resource Graph provides a solution for this. You can use it to query your resources in Azure across subscriptions. Azure Resource Graph is an API that you can use as a REST API, from the Azure portal or from the Azure CLI, Azure PowerShell, and Azure SDK for .NET.
You can do many things with the Azure Resource Graph, like searching for resources that expose IP addresses, or returning all VMs that run Linux. In this post, we'll explore how you can use the Azure Resource Graph from the Azure portal and how you can integrate its results in Azure portal dashboards.
If you want to follow along, you'll need the following:
Let's explore how we can use Azure Resource Graph in the Azure portal.
(Resource Graph Explorer in the search results)
You are now in the Resource Graph Explorer. From here, you can run Azure Resource Graph queries. You create these queries with the Kusto Query Language (KQL), which you also use to query Application Insights and Azure Monitor.
(Resource Graph Explorer in the Azure portal)
On the left side of the Resource Graph explorer, you'll find the resources panel. You can browse through it to find out which resource types and objects you can query.
Let's run some queries.
summarize Count=count() by type
(Bar Chart in Resource Graph Explorer in the Azure portal)
summarize Count=count() by type | order by Count desc
summarize Count=count() by type, location | order by Count desc
(Filter Azure Graph results in the Azure portal)
Azure Resource Graph is a very powerful service in Azure that enables you to get insights into your resources. And now, it is a first-class citizen in the Azure portal. You can pin results to Azure portal dashboards and even create interactive charts from them, just by selecting a chart as the format of the result. And you can also create filters in your Azure portal dashboard that filter the results of the Resource Graph queries. This is really powerful. Go and check it out!