Diagnostic Target

Many resources allow Diagnostic logging to be enabled to one or more target sources. Although the metrics are specific to each type of resource, the target information of how and where are common and described by the Diagnostic Target object.

Diagnostic Target

Attribute Type Mandatory Values Default Notes
Blob Object No * * At least 1 of the 3 targets is required
EventHub Object No * * At least 1 of the 3 targets is required
LogAnalytics Object No * * At least 1 of the 3 targets is required

Diagnostic Target Blob

Attribute Type Mandatory Values Default Notes
StorageAccount String Yes
StorageKeyType String Yes Primary, Secondary
RetentionInDays String No
ResourceGroupName String No Defaults to RG of the resource
SubscriptionName String No Defaults to Sub of the resource

Diagnostic Target EventHub

Attribute Type Mandatory Values Default Notes
Name String Yes
Namespace String Yes
SharedAccessPolicy String No Defaults to RootManageSharedAccessKey
ResourceGroupName String No Defaults to RG of the resource
SubscriptionName String No Defaults to Sub of the resource

Diagnostic Target LogAnalytics

Attribute Type Mandatory Values Default Notes
Workspace String Yes
ResourceGroupName String No Defaults to RG of the resource
SubscriptionName String No Defaults to Sub of the resource

Input by YAML

Object model for YAML deployment:

    Diagnostic:
      - Name: 'string'
        Log:
          Enabled: boolean                          # True (D if Category not null), False
          Category: [array]                         # Defaults to all if enabled
        Metric:
          Enabled: boolean                          # True (D if MetricCategory not null), False
          Category: [array]                         # Defaults to all if enabled
        Target:
          Blob:
            StorageAccount: 'string' 
            StorageKeyType: 'string'                # Primary, Secondary
            RetentionInDays: number
            ResourceGroupName: 'string'             # Defaults to RG of resource
            SubscriptionName: 'string'              # Defaults to Sub of resource
          EventHub:
            Name: 'string'
            Namespace: 'string'
            SharedAccessPolicy: 'string'            # RootManageSharedAccessKey (D)
            ResourceGroupName: 'string'             # Defaults to RG of resource
            SubscriptionName: 'string'              # Defaults to Sub of resource
          LogAnalytics:
            Workspace: 'string'
            ResourceGroupName: 'string'             # Defaults to RG of resource
            SubscriptionName: 'string'              # Defaults to Sub of resource

Input by JSON

Object model for JSON deployment:

{
      "Diagnostic": [
        {
          "Name": "string",
          "Log": {
            "Enabled": boolean,
            "Category": [array]
          },
          "Metric": {
            "Enabled": boolean,
            "Category": [array]
          },
          "Target": {
            "Blob": {
              "StorageAccount": "string",
              "StorageKeyType": "string",
              "RetentionInDays": number,
              "ResourceGroupName": "string",
              "SubscriptionName": "string"
            },
            "EventHub": {
              "Name": "string",
              "Namespace": "string",
              "SharedAccessPolicy": "string",
              "ResourceGroupName": "string",
              "SubscriptionName": "string"
            },
            "LogAnalytics": {
              "Workspace": "string",
              "ResourceGroupName": "string",
              "SubscriptionName": "string"
            }
          }
        }
      ]