Microsoft.AlertsManagement actionRules

Bicep 資源定義

actionRules 資源類型可以部署到:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

資源格式

若要建立 Microsoft.AlertsManagement/actionRules 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.AlertsManagement/actionRules@2021-08-08' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    actions: [
      {
        actionType: 'string'
        // For remaining properties, see Action objects
      }
    ]
    conditions: [
      {
        field: 'string'
        operator: 'string'
        values: [
          'string'
        ]
      }
    ]
    description: 'string'
    enabled: bool
    schedule: {
      effectiveFrom: 'string'
      effectiveUntil: 'string'
      recurrences: [
        {
          endTime: 'string'
          startTime: 'string'
          recurrenceType: 'string'
          // For remaining properties, see Recurrence objects
        }
      ]
      timeZone: 'string'
    }
    scopes: [
      'string'
    ]
  }
}

動作物件

設定 actionType 屬性以指定物件的類型。

針對 AddActionGroups,請使用:

  actionType: 'AddActionGroups'
  actionGroupIds: [
    'string'
  ]

針對 RemoveAllActionGroups,請使用:

  actionType: 'RemoveAllActionGroups'

週期物件

設定 recurrenceType 屬性以指定物件的類型。

針對 [每日],請使用:

  recurrenceType: 'Daily'

針對 [每月],請使用:

  recurrenceType: 'Monthly'
  daysOfMonth: [
    int
  ]

針對 [每週],請使用:

  recurrenceType: 'Weekly'
  daysOfWeek: [
    'string'
  ]

屬性值

actionRules

名稱 描述
NAME 資源名稱 需要字串 ()
location 資源位置 需要字串 ()
tags 資源標籤 標記名稱和值的字典。 請參閱 範本中的標籤
properties 警示處理規則屬性。 AlertProcessingRuleProperties

AlertProcessingRuleProperties

名稱 描述
動作 要套用的動作。 Action[] (必要)
條件 將篩選警示的條件。 Condition[]
description 警示處理規則的描述。 字串
已啟用 指出指定的警示處理規則是否已啟用或停用。 bool
schedule 警示處理規則的排程。 [排程]
範圍 將套用警示處理規則的範圍。 string[] (必要)

動作

名稱 描述
actionType 設定物件類型 AddActionGroups
RemoveAllActionGroups (必要)

AddActionGroups

名稱 描述
actionType 應套用的動作。 需要 'AddActionGroups' ()
actionGroupIds 要新增至警示處理規則的動作群組識別碼清單。 string[] (必要)

RemoveAllActionGroups

名稱 描述
actionType 應套用的動作。 'RemoveAllActionGroups' (必要)

條件

名稱 描述
field 指定條件的欄位。 'AlertCoNtext'
'AlertRuleId'
'AlertRuleName'
'Description'
'MonitorCondition'
'MonitorService'
'Severity'
'SignalType'
'TargetResource'
'TargetResourceGroup'
'TargetResourceType'
! 運算子之後 指定條件的運算子。 'Contains'
'DoesNotContain'
'Equals'
'NotEquals'
要符合指定條件的值清單。 string[]

排程

名稱 描述
effectiveFrom 排程從時間生效。 Date-Time ISO-8601 格式,不含時區尾碼。 字串
effectiveUntil 排程有效直到時間為止。 Date-Time ISO-8601 格式,不含時區尾碼。 字串
復發 週期清單。 週期[]
timeZone 排程時區。 字串

週期性

名稱 描述
EndTime 週期的結束時間。 字串
startTime 週期的開始時間。 字串
recurrenceType 設定物件類型 每日
每月
每週 需要 ()

DailyRecurrence

名稱 描述
recurrenceType 指定何時應套用迴圈。 必要的「每日」 ()

MonthlyRecurrence

名稱 描述
recurrenceType 指定何時應套用迴圈。 需要 「每月」 ()
daysOfMonth 指定每月週期模式的值。 int[] (必要)

WeeklyRecurrence

名稱 描述
recurrenceType 指定何時應套用迴圈。 必要) 需要 「每週」 (
daysOfWeek 指定每週週期模式的值。 包含任何專案的字串陣列:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
必要 ()

快速入門範本

下列快速入門範本會部署此資源類型。

[範本] 描述
使用 Azure 監視器設定備份警示的通知

部署至 Azure
此範本可讓您使用 Azure 監視器來設定復原服務保存庫的電子郵件通知,方法是部署警示處理規則和動作群組

ARM 範本資源定義

actionRules 資源類型可以部署到:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄

資源格式

若要建立 Microsoft.AlertsManagement/actionRules 資源,請將下列 JSON 新增至您的範本。

{
  "type": "Microsoft.AlertsManagement/actionRules",
  "apiVersion": "2021-08-08",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "actions": [
      {
        "actionType": "string"
        // For remaining properties, see Action objects
      }
    ],
    "conditions": [
      {
        "field": "string",
        "operator": "string",
        "values": [ "string" ]
      }
    ],
    "description": "string",
    "enabled": "bool",
    "schedule": {
      "effectiveFrom": "string",
      "effectiveUntil": "string",
      "recurrences": [
        {
          "endTime": "string",
          "startTime": "string",
          "recurrenceType": "string"
          // For remaining properties, see Recurrence objects
        }
      ],
      "timeZone": "string"
    },
    "scopes": [ "string" ]
  }
}

動作物件

設定 actionType 屬性以指定物件的類型。

針對 AddActionGroups,請使用:

  "actionType": "AddActionGroups",
  "actionGroupIds": [ "string" ]

針對 RemoveAllActionGroups,請使用:

  "actionType": "RemoveAllActionGroups"

週期物件

設定 recurrenceType 屬性以指定物件的類型。

針對 每日,請使用:

  "recurrenceType": "Daily"

針對 每月,請使用:

  "recurrenceType": "Monthly",
  "daysOfMonth": [ "int" ]

針對 每週,請使用:

  "recurrenceType": "Weekly",
  "daysOfWeek": [ "string" ]

屬性值

actionRules

名稱 描述
type 資源類型 'Microsoft.AlertsManagement/actionRules'
apiVersion 資源 API 版本 '2021-08-08'
NAME 資源名稱 字串 (必要)
location 資源位置 字串 (必要)
tags 資源標籤 標記名稱和值的字典。 請參閱 範本中的標記
properties 警示處理規則屬性。 AlertProcessingRuleProperties

AlertProcessingRuleProperties

名稱 描述
動作 要套用的動作。 Action[] (必要)
條件 將篩選警示的條件。 Condition[]
description 警示處理規則的描述。 字串
已啟用 指出指定的警示處理規則是否已啟用或停用。 bool
schedule 警示處理規則的排程。 [排程]
範圍 要套用警示處理規則的範圍。 string[] (必要)

動作

名稱 描述
actionType 設定物件類型 AddActionGroups
RemoveAllActionGroups (必要)

AddActionGroups

名稱 描述
actionType 應套用的動作。 必要 ('AddActionGroups')
actionGroupIds 要新增至警示處理規則的動作群組識別碼清單。 string[] (必要)

RemoveAllActionGroups

名稱 描述
actionType 應套用的動作。 'RemoveAllActionGroups' (必要)

條件

名稱 描述
field 指定條件的欄位。 'AlertCoNtext'
'AlertRuleId'
'AlertRuleName'
'Description'
'MonitorCondition'
'MonitorService'
'Severity'
'SignalType'
'TargetResource'
'TargetResourceGroup'
'TargetResourceType'
! 運算子之後 指定條件的運算子。 'Contains'
'DoesNotContain'
'Equals'
'NotEquals'
要符合指定條件的值清單。 string[]

排程

名稱 描述
effectiveFrom 排程從時間生效。 Date-Time ISO-8601 格式,不含時區尾碼。 字串
effectiveUntil 排程有效直到時間為止。 Date-Time ISO-8601 格式,不含時區尾碼。 字串
復發 週期清單。 週期[]
timeZone 排程時區。 字串

週期性

名稱 描述
EndTime 週期的結束時間。 字串
startTime 週期的開始時間。 字串
recurrenceType 設定物件類型 每日
每月
每週 需要 ()

DailyRecurrence

名稱 描述
recurrenceType 指定何時應套用迴圈。 必要的「每日」 ()

MonthlyRecurrence

名稱 描述
recurrenceType 指定何時應套用迴圈。 需要 「每月」 ()
daysOfMonth 指定每月週期模式的值。 int[] (必要)

WeeklyRecurrence

名稱 描述
recurrenceType 指定何時應套用迴圈。 必要) 需要 「每週」 (
daysOfWeek 指定每週週期模式的值。 包含任何專案的字串陣列:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
必要 ()

快速入門範本

下列快速入門範本會部署此資源類型。

[範本] 描述
使用 Azure 監視器設定備份警示的通知

部署至 Azure
此範本可讓您使用 Azure 監視器來設定復原服務保存庫的電子郵件通知,方法是部署警示處理規則和動作群組

Terraform (AzAPI 提供者) 資源定義

actionRules 資源類型可以部署到:

  • 資源群組

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄

資源格式

若要建立 Microsoft.AlertsManagement/actionRules 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.AlertsManagement/actionRules@2021-08-08"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      actions = [
        {
          actionType = "string"
          // For remaining properties, see Action objects
        }
      ]
      conditions = [
        {
          field = "string"
          operator = "string"
          values = [
            "string"
          ]
        }
      ]
      description = "string"
      enabled = bool
      schedule = {
        effectiveFrom = "string"
        effectiveUntil = "string"
        recurrences = [
          {
            endTime = "string"
            startTime = "string"
            recurrenceType = "string"
            // For remaining properties, see Recurrence objects
          }
        ]
        timeZone = "string"
      }
      scopes = [
        "string"
      ]
    }
  })
}

動作物件

設定 actionType 屬性以指定物件的類型。

針對 AddActionGroups,請使用:

  actionType = "AddActionGroups"
  actionGroupIds = [
    "string"
  ]

針對 RemoveAllActionGroups,請使用:

  actionType = "RemoveAllActionGroups"

週期物件

設定 recurrenceType 屬性以指定物件的類型。

針對 每日,請使用:

  recurrenceType = "Daily"

針對 每月,請使用:

  recurrenceType = "Monthly"
  daysOfMonth = [
    int
  ]

針對 每週,請使用:

  recurrenceType = "Weekly"
  daysOfWeek = [
    "string"
  ]

屬性值

actionRules

名稱 描述
type 資源類型 「Microsoft.AlertsManagement/actionRules@2021-08-08」
NAME 資源名稱 字串 (必要)
location 資源位置 字串 (必要)
parent_id 若要部署至資源群組,請使用該資源群組的識別碼。 字串 (必要)
tags 資源標籤 標記名稱和值的字典。
properties 警示處理規則屬性。 AlertProcessingRuleProperties

AlertProcessingRuleProperties

名稱 描述
動作 要套用的動作。 Action[] (必要)
條件 將篩選警示的條件。 Condition[]
description 警示處理規則的描述。 字串
已啟用 指出指定的警示處理規則是否已啟用或停用。 bool
schedule 警示處理規則的排程。 [排程]
範圍 要套用警示處理規則的範圍。 string[] (必要)

動作

名稱 描述
actionType 設定物件類型 AddActionGroups
RemoveAllActionGroups (必要)

AddActionGroups

名稱 描述
actionType 應套用的動作。 必要) 「AddActionGroups」 (
actionGroupIds 要新增至警示處理規則的動作群組識別碼清單。 string[] (必要)

RemoveAllActionGroups

名稱 描述
actionType 應套用的動作。 「RemoveAllActionGroups」 (必要)

條件

名稱 描述
field 指定條件的欄位。 「AlertCoNtext」
「AlertRuleId」
「AlertRuleName」
「Description」
「MonitorCondition」
「MonitorService」
「嚴重性」
「SignalType」
「TargetResource」
「TargetResourceGroup」
「TargetResourceType」
! 運算子之後 指定條件的運算子。 「Contains」
「DoesNotContain」
「Equals」
「NotEquals」
要符合指定條件的值清單。 string[]

排程

名稱 描述
effectiveFrom 排程從時間生效。 Date-Time ISO-8601 格式,不含時區尾碼。 字串
effectiveUntil 排程有效直到時間為止。 Date-Time ISO-8601 格式,不含時區尾碼。 字串
復發 週期清單。 週期[]
timeZone 排程時區。 字串

週期性

名稱 描述
EndTime 週期的結束時間。 字串
startTime 週期的開始時間。 字串
recurrenceType 設定物件類型 每日
每月
每週 需要 ()

DailyRecurrence

名稱 描述
recurrenceType 指定何時應套用迴圈。 「每日」 (必要)

MonthlyRecurrence

名稱 描述
recurrenceType 指定何時應套用迴圈。 「每月」 (必要)
daysOfMonth 指定每月週期模式的值。 int[] (必要)

WeeklyRecurrence

名稱 描述
recurrenceType 指定何時應套用迴圈。 必要的「每週」 ()
daysOfWeek 指定每週週期模式的值。 包含任何專案的字串陣列:
"Friday"
"Monday"
"Saturday"
"Sunday"
"Thursday"
"Tuesday"
「星期三」 (必要)