title | description | ms.date | monikerRange |
---|---|---|---|
AzureMonitor@1 - Query Azure Monitor alerts v1 task |
Observe the configured Azure Monitor rules for active alerts. |
05/14/2024 |
>=azure-pipelines-2019.1 |
:::moniker range=">=azure-pipelines-2019.1"
Observe the configured Azure Monitor rules for active alerts.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
# 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.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
connectedServiceNameARM
- Azure subscription
string
. Required.
Selects an Azure Resource Manager subscription to monitor.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
ResourceGroupName
- Resource group
string
. Required.
Provides the name of a resource group to monitor in the subscription.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
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.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
resource
- Resource
string
. Required when filterType = resource
.
Selects the Azure resource to monitor.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
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.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
severity
- Severity
string
. Allowed values: Sev0
, Sev1
, Sev2
, Sev3
, Sev4
. Default value: Sev0,Sev1,Sev2,Sev3,Sev4
.
Filters by severity.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
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.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
alertState
- Alert state
string
. Allowed values: New
, Acknowledged
, Closed
. Default value: Acknowledged,New
.
Filters by the state of the alert instance.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
monitorCondition
- Monitor condition
string
. Allowed values: Fired
(Fired), Resolved
. Default value: Fired
.
Represents whether the underlying conditions have crossed the defined alert rule thresholds.
:::moniker-end
All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.
:::moniker range=">=azure-pipelines-2019.1"
None.
:::moniker-end
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.
:::moniker range=">=azure-pipelines-2019.1"
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 |
:::moniker-end