Microsoft Secure Tech Accelerator
Apr 03 2024, 07:00 AM - 11:00 AM (PDT)
Microsoft Tech Community

Is there a way to find total Virtual machines using Azure logs

Copper Contributor
I want to collect data for all the VMs present. But I am able to use only VMComputer and Heartbeat table for this. It doesn't has the data for the VMs which are in shut down state. I need data for all the VMs using log analytics.
3 Replies

@uditk14 What data are you talking about obtaining?  You will not be able to get any data from any of the monitoring agents if the VM is not running.  You can have some VM Diagnostic settings get pushed to Azure Sentinel if there is any data in those that may be useful

 

 

@Gary Bushey - I would like to fetch the AzureSize, AzureLocation, Physical Memory for all the VMs

@uditk14 

 

Some of that data is available in other Tables or from Metrics / API.  See example Workbook here which uses Metrics 

Annotation 2020-06-19 095147.jpg 

AzureActivity logs would help you, if you can add those?

 

If not you'll have to use something like a Workbook, pull data from the api or ARG (Azure resourceGraph) and merge with Heartbeat.  A bit like this: 

https://cloudblogs.microsoft.com/industry-blog/en-gb/cross-industry/2020/03/16/azure-monitor-workboo...