insightsresources
| where type == "microsoft.insights/datacollectionruleassociations"
| parse properties with * '/' PROP'"'*
| extend PROPdetails = split(PROP, "/")
| extend DCRstring = tostring(PROPdetails[7])
| extend fullline = strcat(DCRstring,"",id)
| extend fulllinedetails = split(fullline,"/")
| extend DCRname = tostring(fulllinedetails[0])
| extend Computer = tostring(fulllinedetails[8])
| project DCRname, Computer
| distinct DCRname, Computer
Azure Monitor DCR Associated Resource List
Hi,
I have Azure Monitor DCR created and associated some VMs to it. Now I would like to create a Dashboard with below details. Appreciate if some could help and provide me some pointers.
- VM Names associated with specific DCR.
- VM names, which are not heart beating in last 24 hours.
- VM names which are not sending any performance data in last 24 hours.
I could write KQL for last 2 items, if i could get List of VMs associated with specific DCR but that detail is not available neither in Log Analytic Workspace nor in Resource Graph Explorer Namespaces.
I also tried PowerShell Cmdlet (below) but not sure how to use that, while writing KQL queries to filter the data.
Ref: https://github.com/Azure/azure-powershell/blob/main/src/Monitor/Monitor/help/Get-AzDataCollectionRuleAssociation.md
Appreciate, if someone could help me for the same !!
Regards, Ravi
Azure Monitor
-
Predrag Oparnica 80 Reputation points Microsoft Employee2025-07-25T14:55:01.8966667+00:00
1 additional answer
Sort by: Most helpful
-
SwathiDhanwada-MSFT 19,073 Reputation points Moderator
2022-01-17T08:53:45.84+00:00 @Ravi Gupta Welcome to Microsoft Q & A Community Forum. To retrieve the list of virtual machines that are linked to data collection rule, you could use the PowerShell command Get-AzDataCollectionRuleAssociation ( which you are already aware ). However , if you want to retrieve this information using KQL query , its not possible .
One workaround is that Azure Dashboard also visualizes data that is retrieved using Azure REST API. Use Azure Monitor REST API to retrieve the list of vm's associated with specific DCR and visualize it accordingly.