AzureMonitor@1 - Query Azure Monitor alerts v1 task
Observe the configured Azure Monitor rules for active alerts.
Syntax
# Query Azure Monitor alerts v1
# Observe the configured Azure Monitor rules for active alerts.
- task: AzureMonitor@1
inputs:
connectedServiceNameARM: # string. Required. Azure subscription.
ResourceGroupName: # string. Required. Resource group.
# Advanced
filterType: 'none' # 'resource' | 'alertrule' | 'none'. Required. Filter type. Default: none.
#resource: # string. Required when filterType = resource. Resource.
#alertRule: # string. Required when filterType = alertrule. Alert rule.
#severity: 'Sev0,Sev1,Sev2,Sev3,Sev4' # 'Sev0' | 'Sev1' | 'Sev2' | 'Sev3' | 'Sev4'. Severity. Default: Sev0,Sev1,Sev2,Sev3,Sev4.
#timeRange: '1h' # '1h' | '1d' | '7d' | '30d'. Time range. Default: 1h.
#alertState: 'Acknowledged,New' # 'New' | 'Acknowledged' | 'Closed'. Alert state. Default: Acknowledged,New.
#monitorCondition: 'Fired' # 'Fired ' | 'Resolved'. Monitor condition. Default: Fired.
Inputs
connectedServiceNameARM
- Azure subscription
string
. Required.
Selects an Azure Resource Manager subscription to monitor.
ResourceGroupName
- Resource group
string
. Required.
Provides the name of a resource group to monitor in the subscription.
filterType
- Filter type
string
. Required. Allowed values: resource
(By resource), alertrule
(By alert rule), none
. Default value: none
.
Filters the type by a specific resource or alert rule.
resource
- Resource
string
. Required when filterType = resource
.
Selects the Azure resource to monitor.
alertRule
- Alert rule
string
. Required when filterType = alertrule
.
Selects from the currently configured alert rules to query for the status.
The default value is to select all.
severity
- Severity
string
. Allowed values: Sev0
, Sev1
, Sev2
, Sev3
, Sev4
. Default value: Sev0,Sev1,Sev2,Sev3,Sev4
.
Filters by severity.
timeRange
- Time range
string
. Allowed values: 1h
(Past hour), 1d
(Past 24 hours), 7d
(Past 7 days), 30d
(Past 30 days). Default value: 1h
.
Filters by the time range.
alertState
- Alert state
string
. Allowed values: New
, Acknowledged
, Closed
. Default value: Acknowledged,New
.
Filters by the state of the alert instance.
monitorCondition
- Monitor condition
string
. Allowed values: Fired
(Fired), Resolved
. Default value: Fired
.
Represents whether the underlying conditions have crossed the defined alert rule thresholds.
Task control options
All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.
Output variables
None.
Remarks
To observe the configured Azure monitor rules for active alerts, use this task in an agentless job of a release pipeline.
Note
This task can only be used in an agentless job of a release pipeline.
The task succeeds if none of the alert rules are activated at the time of sampling.
For more information about using this task, see Approvals and gates overview.
Requirements
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build, Classic release |
Runs on | Server, ServerGate |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | Any |
Settable variables | Any |
Agent version | All supported agent versions. |
Task category | Utility |