Data collection rule should have destinations configured

High Azure General datacollectionrules-data-collection-rule-destinati

Applies to

  • Microsoft.Insights/dataCollectionRules

What CGPulse checks

A resource passes this rule when destinationsCount must be one of [1]. Anything else is reported as a finding with the evaluated property value attached as evidence.

How to fix it

Configure destinations to define where collected monitoring data is sent. In Azure Portal: Monitor > Data Collection Rules > select rule > add destination. See: https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/data-collection-rule-overview

CLI

az monitor data-collection rule show --ids "{id}" --query "destinations" -o json

Bicep

resource dcr 'Microsoft.Insights/dataCollectionRules@2023-03-11' = {{
  name: '{name}'
  location: resourceGroup().location
  properties: {{
    destinations: {{
      logAnalytics: [
        {{
          workspaceResourceId: '<workspace-id>'
          name: 'logAnalytics'
        }}
      ]
    }}
    dataFlows: [
      {{
        streams: ['Microsoft-Perf']
        destinations: ['logAnalytics']
      }}
    ]
  }}
}}

Terraform

resource "azurerm_monitor_data_collection_rule" "{name}" {
  name                = "{name}"
  resource_group_name = "{rg}"
  location            = var.location
  destinations {
    log_analytics {
      workspace_resource_id = "<workspace-id>"
      name                  = "log-analytics"
    }
  }
  data_flow {
    streams      = ["Microsoft-Perf"]
    destinations = ["log-analytics"]
  }
}

Compliance frameworks

Is your environment compliant with this rule?

CGPulse checks it — and 621 others — against your Azure and AWS accounts with read-only access.

Run a free scan

Related Azure rules

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.