dashboard

Azure Dashboard using Resource Graph Explorer

At this post we will see how we can Visualise our Azure environment using the Resource Graph Explorer. Resource Graph Explorer allows you to run Resource Graph queries, create charts and pin them to the Azure Dashboard.

Resource Graph Explorer is part of Azure Governance. You can find more guides about Azure Governance at my posts like How to limit the Azure VM Sizes and How to enforce tags for resources creation using the Azure Governance tag.

Create a chart showing the number of VMs by Operating System at my tenant.

Open the Azure Portal and search for the Resource Graph Explorer and open it

azure dashboard

The window that will open looks familiar because it uses the same query language like Log Analytics, the Kusto. On the right side, at the Resource Window, you can search for any resource type, click it and it will be added to the Query Window. We will start with the “resources” that will bring us all resources

resource graph

Then we will search for virtual machines to find the correct type

azure dashboard

clicking the microsoft.computer/virtualmachines it will automatically change the query to narrow the search to bring only the Virtual Machines

kusto

To see the results just press “Run Query”. At the Resources window you can see all the VMs properties, like name, location, tags, resourcegroup and a property named “properties”. If you open this you will see all the details of the VMs.

kusto

The Operating System property is under “storageProfile” / “osDisk” / osType. So we need to alter our query like this:

resources
 | where type == "microsoft.compute/virtualmachines"
 | summarize count() by tostring(properties.storageProfile.osDisk.osType)

Running the above query will bring the VMs by OS. Next Results you can click Charts to select the Chart you like.

azure dashboard

You can save the query to add a name and also reuse it. The name will appear once we add the chart to the Azure Dashboard, it will be the title.

save query

For our Dashboard I will use a Donut chart. To add it to the Azure Dashboard click “Pin to dashboard”

pin

And this is the dashboard view

azure dashboard

We can add more resources, like Public IP Addresses

Change the query to this:

Resources
 | where type == "microsoft.network/publicipaddresses"

Run it and you will get a result with all Public IP Addresses

kusto

To expand the properties, add the ” | project properties ” at the query and  click the “see details” link.

properties

View the properties details and find the name of the ip address key

details

To create a chart with all Public IP Addresses run the below query

Resources  
| where type == "microsoft.network/publicipaddresses"
| summarize count() by tostring(properties.ipAddress)

And this is the result, pined to Azure Dashboard

azure dashboard

Add a chart to show the location of all of my resources

summarize count() by location | project  location, total=count_| order by total desc 
| where total > 1

azure dashboard

Now at my Azure Dashboard I have VMs per OS, all Public IP Addresses and the location of all of my resources

azure dashboard

 

Find more at the Azure Resource Graph documentation

Share

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *