Azure Monitor DCR Associated Resource List

Ravi Gupta 1 Reputation point
2022-01-13T07:04:51.133+00:00

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.

  1. VM Names associated with specific DCR.
  2. VM names, which are not heart beating in last 24 hours.
  3. 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
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,271 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 18,766 Reputation points
    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.