-
Notifications
You must be signed in to change notification settings - Fork 2
/
modules.alertRulesDataFactoryExecutions.bicep
59 lines (54 loc) · 1.94 KB
/
modules.alertRulesDataFactoryExecutions.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@description('The prefix will be used for every parameter that represents a resource name')
param resourceNamePrefix string
@description('The suffix will be appended to every parameter that represents a resource name')
param resourceNameSuffix string
param dataFactoryResId string
param actionGroupResId string
param enableAlertRules bool = true
var alertRuleFailedPipelineRunsName = '${resourceNamePrefix}-dfpfails-ar-${resourceNameSuffix}'
resource alertRuleFailedPipelineRunsRes 'Microsoft.Insights/metricalerts@2018-03-01' = if (!empty(actionGroupResId) && !empty(dataFactoryResId)) {
name: alertRuleFailedPipelineRunsName
location: 'global'
properties: {
description: 'Informs about failed pipeline executions. See https://learn.microsoft.com/en-us/azure/data-factory/monitor-metrics-alerts'
severity: 1
enabled: enableAlertRules
scopes: [
dataFactoryResId
]
targetResourceType: 'Microsoft.DataFactory/factories'
evaluationFrequency: 'PT1H' // Must be one of [PT1M, PT5M, PT15M, PT30M, PT1H]
windowSize: 'PT1H' // Must be one of [PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H, P1D]
criteria: {
allOf: [
{
threshold: 0
name: 'FailedRuns' // Required name to identify criteria - can have any value
metricNamespace: 'Microsoft.DataFactory/factories'
metricName: 'PipelineFailedRuns'
dimensions: [
{
name: 'Name'
operator: 'Include'
values: [
'*'
]
}
]
operator: 'GreaterThan'
timeAggregation: 'Total'
criterionType: 'StaticThresholdCriterion'
}
]
'odata.type': 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria'
}
autoMitigate: false // Auto-resolve (default = true)
actions: [
{
actionGroupId: actionGroupResId
webHookProperties: {
}
}
]
}
}