AzureMonitor@1 - 查詢 Azure 監視器警示 v1 工作

觀察作用中警示的已設定 Azure 監視器規則。

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.

輸入

connectedServiceNameARM - Azure 訂用帳戶
string. 必要。

選取要監視的 Azure Resource Manager訂用帳戶。


ResourceGroupName - 資源群組
string. 必要。

提供訂用帳戶中要監視的資源群組名稱。


filterType - 篩選類型
string. 必要。 允許的值: resource 依資源) (, alertrule (依警示規則) none 。 預設值:none

依特定資源或警示規則篩選類型。


resource - 資源
string. 需要 。 filterType = resource

選取要監視的 Azure 資源。


alertRule - 警示規則
string. 需要 。 filterType = alertrule

從目前設定的警示規則中選取以查詢狀態。

預設值為全部選取。


severity - 嚴重性
string. 允許的值: Sev0 、、 Sev1Sev2Sev3 、、 Sev4 。 預設值:Sev0,Sev1,Sev2,Sev3,Sev4

依嚴重性篩選。


timeRange - 時間範圍
string. 允許的值: 1h (過去一小時) 、 1d (過去 24 小時) (、 7d 過去 7 天 30d) (過去 30 天) 。 預設值:1h

依時間範圍篩選。


alertState - 警示狀態
string. 允許值:NewAcknowledgedClosed。 預設值:Acknowledged,New

依警示實例的狀態進行篩選。


monitorCondition - 監視條件
string. 允許的值: Fired (引發) 、 Resolved 。 預設值:Fired

表示基礎條件是否已超過定義的警示規則閾值。


工作控制項選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制選項和一般工作屬性

輸出變數

無。

備註

若要觀察作用中警示的已設定 Azure 監視器規則,請在發行管線的 無代理程式作業 中使用這項工作。

注意

此工作只能在發行管線的 無代理程式作業 中使用。

如果取樣時未啟用任何警示規則,工作就會成功。

如需使用此工作的詳細資訊,請參閱 核准和閘道概觀

規格需求

需求 說明
管線類型 YAML、傳統組建、傳統版本
在 上執行 Server、ServerGate
要求
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任意
可設定變數 任意
代理程式版本 所有支援的代理程式版本。
工作類別 公用程式