microsoft.insights guestDiagnosticSettings

Bicep resource definition

The guestDiagnosticSettings resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a microsoft.insights/guestDiagnosticSettings resource, add the following Bicep to your template.

resource symbolicname 'microsoft.insights/guestDiagnosticSettings@2018-06-01-preview' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    dataSources: [
      {
        configuration: {
          eventLogs: [
            {
              filter: 'string'
              logName: 'string'
            }
          ]
          perfCounters: [
            {
              instance: 'string'
              name: 'string'
              samplingPeriod: 'string'
            }
          ]
          providers: [
            {
              events: [
                {
                  filter: 'string'
                  id: int
                  name: 'string'
                }
              ]
              id: 'string'
            }
          ]
        }
        kind: 'string'
        sinks: [
          {
            kind: 'string'
          }
        ]
      }
    ]
    osType: 'string'
    proxySetting: 'string'
  }
}

Property values

guestDiagnosticSettings

Name Description Value
name The resource name string (required)
location Resource location string (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
properties The diagnostic settings to be applied to azure resources. GuestDiagnosticSettings (required)

GuestDiagnosticSettings

Name Description Value
dataSources the array of data source object which are configured to collect and send data DataSource[]
osType Operating system type for the configuration 'Linux'
'Windows'
proxySetting string

DataSource

Name Description Value
configuration DataSourceConfiguration (required)
kind Datasource kind 'ETWProviders'
'PerformanceCounter'
'WindowsEventLogs' (required)
sinks SinkConfiguration[] (required)

DataSourceConfiguration

Name Description Value
eventLogs Windows event logs configuration. EventLogConfiguration[]
perfCounters Performance counter configuration PerformanceCounterConfiguration[]
providers ETW providers configuration EtwProviderConfiguration[]

EventLogConfiguration

Name Description Value
filter string
logName string (required)

PerformanceCounterConfiguration

Name Description Value
instance string
name string (required)
samplingPeriod string (required)

EtwProviderConfiguration

Name Description Value
events EtwEventConfiguration[] (required)
id string (required)

EtwEventConfiguration

Name Description Value
filter string
id int (required)
name string (required)

SinkConfiguration

Name Description Value
kind 'ApplicationInsights'
'EventHub'
'LogAnalytics' (required)

ARM template resource definition

The guestDiagnosticSettings resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a microsoft.insights/guestDiagnosticSettings resource, add the following JSON to your template.

{
  "type": "microsoft.insights/guestDiagnosticSettings",
  "apiVersion": "2018-06-01-preview",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "dataSources": [
      {
        "configuration": {
          "eventLogs": [
            {
              "filter": "string",
              "logName": "string"
            }
          ],
          "perfCounters": [
            {
              "instance": "string",
              "name": "string",
              "samplingPeriod": "string"
            }
          ],
          "providers": [
            {
              "events": [
                {
                  "filter": "string",
                  "id": "int",
                  "name": "string"
                }
              ],
              "id": "string"
            }
          ]
        },
        "kind": "string",
        "sinks": [
          {
            "kind": "string"
          }
        ]
      }
    ],
    "osType": "string",
    "proxySetting": "string"
  }
}

Property values

guestDiagnosticSettings

Name Description Value
type The resource type 'microsoft.insights/guestDiagnosticSettings'
apiVersion The resource api version '2018-06-01-preview'
name The resource name string (required)
location Resource location string (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
properties The diagnostic settings to be applied to azure resources. GuestDiagnosticSettings (required)

GuestDiagnosticSettings

Name Description Value
dataSources the array of data source object which are configured to collect and send data DataSource[]
osType Operating system type for the configuration 'Linux'
'Windows'
proxySetting string

DataSource

Name Description Value
configuration DataSourceConfiguration (required)
kind Datasource kind 'ETWProviders'
'PerformanceCounter'
'WindowsEventLogs' (required)
sinks SinkConfiguration[] (required)

DataSourceConfiguration

Name Description Value
eventLogs Windows event logs configuration. EventLogConfiguration[]
perfCounters Performance counter configuration PerformanceCounterConfiguration[]
providers ETW providers configuration EtwProviderConfiguration[]

EventLogConfiguration

Name Description Value
filter string
logName string (required)

PerformanceCounterConfiguration

Name Description Value
instance string
name string (required)
samplingPeriod string (required)

EtwProviderConfiguration

Name Description Value
events EtwEventConfiguration[] (required)
id string (required)

EtwEventConfiguration

Name Description Value
filter string
id int (required)
name string (required)

SinkConfiguration

Name Description Value
kind 'ApplicationInsights'
'EventHub'
'LogAnalytics' (required)

Terraform (AzAPI provider) resource definition

The guestDiagnosticSettings resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a microsoft.insights/guestDiagnosticSettings resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "microsoft.insights/guestDiagnosticSettings@2018-06-01-preview"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      dataSources = [
        {
          configuration = {
            eventLogs = [
              {
                filter = "string"
                logName = "string"
              }
            ]
            perfCounters = [
              {
                instance = "string"
                name = "string"
                samplingPeriod = "string"
              }
            ]
            providers = [
              {
                events = [
                  {
                    filter = "string"
                    id = int
                    name = "string"
                  }
                ]
                id = "string"
              }
            ]
          }
          kind = "string"
          sinks = [
            {
              kind = "string"
            }
          ]
        }
      ]
      osType = "string"
      proxySetting = "string"
    }
  })
}

Property values

guestDiagnosticSettings

Name Description Value
type The resource type "microsoft.insights/guestDiagnosticSettings@2018-06-01-preview"
name The resource name string (required)
location Resource location string (required)
parent_id To deploy to a resource group, use the ID of that resource group. string (required)
tags Resource tags Dictionary of tag names and values.
properties The diagnostic settings to be applied to azure resources. GuestDiagnosticSettings (required)

GuestDiagnosticSettings

Name Description Value
dataSources the array of data source object which are configured to collect and send data DataSource[]
osType Operating system type for the configuration "Linux"
"Windows"
proxySetting string

DataSource

Name Description Value
configuration DataSourceConfiguration (required)
kind Datasource kind "ETWProviders"
"PerformanceCounter"
"WindowsEventLogs" (required)
sinks SinkConfiguration[] (required)

DataSourceConfiguration

Name Description Value
eventLogs Windows event logs configuration. EventLogConfiguration[]
perfCounters Performance counter configuration PerformanceCounterConfiguration[]
providers ETW providers configuration EtwProviderConfiguration[]

EventLogConfiguration

Name Description Value
filter string
logName string (required)

PerformanceCounterConfiguration

Name Description Value
instance string
name string (required)
samplingPeriod string (required)

EtwProviderConfiguration

Name Description Value
events EtwEventConfiguration[] (required)
id string (required)

EtwEventConfiguration

Name Description Value
filter string
id int (required)
name string (required)

SinkConfiguration

Name Description Value
kind "ApplicationInsights"
"EventHub"
"LogAnalytics" (required)