An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
Hello Aditi Sharma, It looks like you are trying to retrieve the list of servers (VMs / Arc machines) associated with a Data Collection Rule (DCR) in Microsoft Azure. But the Azure portal does not provide a direct view, number of associated servers is decreasing and there are no visible disassociation events in Activity Logs.
DCR associations are stored as Data Collection Rule Associations (DCRAs). The portal doesn’t show a consolidated list of servers tied to a DCR. You need to use CLI, PowerShell, or Resource Graph to query associations.
To get the list associated servers for the DCR, use the Azure Resource Graph Explorer for the "Source of Truth."
- Search for Resource Graph Explorer in the Azure Portal.
- Run the following query to see every server currently linked to a DCR:
resources
| where type =~ 'microsoft.insights/datacollectionruleassociations'
| extend dcrId = tostring(properties.dataCollectionRuleId)
| extend targetResourceId = tostring(properties.resourceId)
| project targetResourceId, dcrId, AssociationName = name, location
| join kind=leftouter (
resources | project VMName = name, id
) on $left.targetResourceId == $right.id
| project VMName, targetResourceId, dcrId
DCR associations are control‑plane objects. Some association lifecycle events are handled by Azure Monitor Configuration Service. These changes do not always emit Activity Log entries.
Manage data collection rule associations in Azure Monitor - Azure Monitor | Microsoft Learn
But you can try to look for the Association deletion, not the VM deletion:
- Go to Monitor > Activity Log.
- Set the Timespan to the last 24 - 48 hours.
- Add a filter: Resource Type =
Microsoft.Insights/dataCollectionRuleAssociations. - Look for the operation "Delete Data Collection Rule Association".
- Check the "Event initiated by" column. It will likely show a Service Principal (Automation) or a specific User Email.
For example:
resourcechanges
| where resourceType == "microsoft.insights/datacollectionruleassociations"
| where changeType == "Delete"
| project timestamp, targetResourceId, changedBy
Hope that helps you list out all servers! please feel free to reach out if you have any further questions. Thanks