Wednesday, April 21, 2021

Introduction to Azure Resource Graph

Azure cloud is a container of resources.

Your resources can be spread across multiple subscriptions and you may have resources from various resource providers (e.g Disks, VMs, Networks, etc..) 

How can you get an aggregated or nested query result of your azure resources? Yes, you can do it with Azure PowerShell with some effort. Is there any easier and rich alternative.

Azure Resource Graph will come to your rescue.

What is Azure Resource Graph?
  • Azure Resource Graph itself is a resource provider
  • Resource Graph periodically scan Azure Resource Manager (ARM) for any changes to resources and imports those changes to its internal database
  • Scheduled changes of resources are notified to Azure Resource Graph (Change Notification)
  • This is a free service (hence a user quota is applied)
  • This can be considered as a powerful inventory system for Azure resources.
Okay, What is the usage of Resource Graph?

Inquire information

As I mentioned earlier, this is an inventory of Azure resources. We can query even across multiple subscriptions.
In order to query, you need to navigate to Azure Resource Graph Explorer
We can use Kusto Query Language (KQL) to query.


















As you can see there is a link to pin query results to a dashboard













Since this is very powerful, Azure uses Resource Graph to populate information in Azure Portal.















You can load the Graph query by navigating to Open query link









        






Another important feature of Resource Graph is that we can scope our queries to different levels. Following are the options available
  • Directory
  • Management Group
  • Subscription
Once your query is completed, you can save queries in private or shared galleries' and consume whenever necessary.

Change Tracking

Whenever there is a change of a resource, it will be notified to Azure Resource Graph. We can use Application Change Analysis feature of Azure to check the change history of a resource.

Application Change Analysis uses Azure Resource Graph in order to obtain history of changes




  




No comments: