Skip to main content

diagnostictarget

+++ title = "Diagnostic Target" description = "Diagnostic Target" weight = 10 alwaysopen = false +++

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

AttributeTypeMandatoryValuesDefaultNotes
BlobObjectNo ** At least 1 of the 3 targets is required
EventHubObjectNo ** At least 1 of the 3 targets is required
LogAnalyticsObjectNo ** At least 1 of the 3 targets is required

Diagnostic Target Blob

AttributeTypeMandatoryValuesDefaultNotes
StorageAccountStringYes
StorageKeyTypeStringYesPrimary, Secondary
RetentionInDaysStringNo
ResourceGroupNameStringNoDefaults to RG of the resource
SubscriptionNameStringNoDefaults to Sub of the resource

Diagnostic Target EventHub

AttributeTypeMandatoryValuesDefaultNotes
NameStringYes
NamespaceStringYes
SharedAccessPolicyStringNoDefaults to RootManageSharedAccessKey
ResourceGroupNameStringNoDefaults to RG of the resource
SubscriptionNameStringNoDefaults to Sub of the resource

Diagnostic Target LogAnalytics

AttributeTypeMandatoryValuesDefaultNotes
WorkspaceStringYes
ResourceGroupNameStringNoDefaults to RG of the resource
SubscriptionNameStringNoDefaults 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"
}
}
}
]