你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.AlertsManagement actionRules 2019-05-05-preview

Bicep 资源定义

可以使用目标操作部署 actionRules 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.AlertsManagement/actionRules 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.AlertsManagement/actionRules@2019-05-05-preview' = {
  location: 'string'
  name: 'string'
  properties: {
    conditions: {
      alertContext: {
        operator: 'string'
        values: [
          'string'
        ]
      }
      alertRuleId: {
        operator: 'string'
        values: [
          'string'
        ]
      }
      alertRuleName: {
        operator: 'string'
        values: [
          'string'
        ]
      }
      description: {
        operator: 'string'
        values: [
          'string'
        ]
      }
      monitorCondition: {
        operator: 'string'
        values: [
          'string'
        ]
      }
      monitorService: {
        operator: 'string'
        values: [
          'string'
        ]
      }
      severity: {
        operator: 'string'
        values: [
          'string'
        ]
      }
      targetResourceType: {
        operator: 'string'
        values: [
          'string'
        ]
      }
    }
    description: 'string'
    scope: {
      scopeType: 'string'
      values: [
        'string'
      ]
    }
    status: 'string'
    type: 'string'
    // For remaining properties, see ActionRuleProperties objects
  }
  tags: {
    {customized property}: 'string'
  }
}

ActionRuleProperties 对象

设置 类型 属性以指定对象的类型。

对于 ActionGroup,请使用:

{
  actionGroupId: 'string'
  type: 'ActionGroup'
}

对于 诊断,请使用:

{
  type: 'Diagnostics'
}

对于 抑制,请使用:

{
  suppressionConfig: {
    recurrenceType: 'string'
    schedule: {
      endDate: 'string'
      endTime: 'string'
      recurrenceValues: [
        int
      ]
      startDate: 'string'
      startTime: 'string'
    }
  }
  type: 'Suppression'
}

属性值

ActionGroup

名字 描述 价值
actionGroupId 操作规则匹配时触发的操作组 string (必需)
类型 指示操作规则的类型 “ActionGroup”(必需)

ActionRuleProperties

名字 描述 价值
条件 将筛选警报的条件 条件
描述 操作规则的说明 字符串
范围 将应用操作规则的范围 范围
地位 指示给定的操作规则是启用或禁用的 “Disabled”
“Enabled”
类型 对于 ActionGroup类型,设置为“ActionGroup”。 对于诊断 类型,设置为“诊断”。 对于类型 抑制,设置为“抑制”。 “ActionGroup”
“诊断”
“抑制”(必需)

条件

名字 描述 价值
算子 给定条件的运算符 “Contains”
“DoesNotContain”
“Equals”
“NotEquals”
要匹配给定条件的值列表。 string[]

条件

名字 描述 价值
alertContext 按警报上下文筛选警报(有效负载) 条件
alertRuleId 按警报规则 ID 筛选警报 条件
alertRuleName 按警报规则名称筛选警报 条件
描述 按警报规则说明筛选警报 条件
monitorCondition 按监视条件筛选警报 条件
monitorService 按监视服务筛选警报 条件
严厉 按严重性筛选警报 条件
targetResourceType 按目标资源类型筛选警报 条件

诊断

名字 描述 价值
类型 指示操作规则的类型 “诊断”(必需)

ManagedResourceTags

名字 描述 价值

Microsoft.AlertsManagement/actionRules

名字 描述 价值
位置 资源位置 string (必需)
名字 资源名称 string (必需)
性能 操作规则属性 ActionRuleProperties
标签 资源标记 标记名称和值的字典。 请参阅模板 中的 标记

范围

名字 描述 价值
scopeType 目标范围的类型 “Resource”
“ResourceGroup”
“订阅”
给定范围类型的 ARM ID 列表,这些 ID 将是给定操作规则的目标。 string[]

抑制

名字 描述 价值
suppressionConfig 操作规则的抑制配置 SuppressionConfig (必需)
类型 指示操作规则的类型 “抑制”(必需)

SuppressionConfig

名字 描述 价值
recurrenceType 指定何时应应用抑制 “Always”
“每日”
“Monthly”
“Once”
“每周”(必需)
附表 抑制计划配置 SuppressionSchedule

SuppressionSchedule

名字 描述 价值
endDate 抑制结束日期 字符串
endTime 抑制结束日期 字符串
recurrenceValues 指定定期模式的值 int[]
startDate 抑制的开始日期 字符串
startTime 抑制的开始时间 字符串

快速入门示例

以下快速入门示例部署此资源类型。

Bicep 文件 描述
使用 Azure Monitor 为备份警报 设置通知 通过此模板,可以使用 Azure Monitor 为恢复服务保管库设置电子邮件通知,方法是部署警报处理规则和操作组

ARM 模板资源定义

可以使用目标操作部署 actionRules 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.AlertsManagement/actionRules 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.AlertsManagement/actionRules",
  "apiVersion": "2019-05-05-preview",
  "name": "string",
  "location": "string",
  "properties": {
    "conditions": {
      "alertContext": {
        "operator": "string",
        "values": [ "string" ]
      },
      "alertRuleId": {
        "operator": "string",
        "values": [ "string" ]
      },
      "alertRuleName": {
        "operator": "string",
        "values": [ "string" ]
      },
      "description": {
        "operator": "string",
        "values": [ "string" ]
      },
      "monitorCondition": {
        "operator": "string",
        "values": [ "string" ]
      },
      "monitorService": {
        "operator": "string",
        "values": [ "string" ]
      },
      "severity": {
        "operator": "string",
        "values": [ "string" ]
      },
      "targetResourceType": {
        "operator": "string",
        "values": [ "string" ]
      }
    },
    "description": "string",
    "scope": {
      "scopeType": "string",
      "values": [ "string" ]
    },
    "status": "string",
    "type": "string"
    // For remaining properties, see ActionRuleProperties objects
  },
  "tags": {
    "{customized property}": "string"
  }
}

ActionRuleProperties 对象

设置 类型 属性以指定对象的类型。

对于 ActionGroup,请使用:

{
  "actionGroupId": "string",
  "type": "ActionGroup"
}

对于 诊断,请使用:

{
  "type": "Diagnostics"
}

对于 抑制,请使用:

{
  "suppressionConfig": {
    "recurrenceType": "string",
    "schedule": {
      "endDate": "string",
      "endTime": "string",
      "recurrenceValues": [ "int" ],
      "startDate": "string",
      "startTime": "string"
    }
  },
  "type": "Suppression"
}

属性值

ActionGroup

名字 描述 价值
actionGroupId 操作规则匹配时触发的操作组 string (必需)
类型 指示操作规则的类型 “ActionGroup”(必需)

ActionRuleProperties

名字 描述 价值
条件 将筛选警报的条件 条件
描述 操作规则的说明 字符串
范围 将应用操作规则的范围 范围
地位 指示给定的操作规则是启用或禁用的 “Disabled”
“Enabled”
类型 对于 ActionGroup类型,设置为“ActionGroup”。 对于诊断 类型,设置为“诊断”。 对于类型 抑制,设置为“抑制”。 “ActionGroup”
“诊断”
“抑制”(必需)

条件

名字 描述 价值
算子 给定条件的运算符 “Contains”
“DoesNotContain”
“Equals”
“NotEquals”
要匹配给定条件的值列表。 string[]

条件

名字 描述 价值
alertContext 按警报上下文筛选警报(有效负载) 条件
alertRuleId 按警报规则 ID 筛选警报 条件
alertRuleName 按警报规则名称筛选警报 条件
描述 按警报规则说明筛选警报 条件
monitorCondition 按监视条件筛选警报 条件
monitorService 按监视服务筛选警报 条件
严厉 按严重性筛选警报 条件
targetResourceType 按目标资源类型筛选警报 条件

诊断

名字 描述 价值
类型 指示操作规则的类型 “诊断”(必需)

ManagedResourceTags

名字 描述 价值

Microsoft.AlertsManagement/actionRules

名字 描述 价值
apiVersion API 版本 '2019-05-05-preview'
位置 资源位置 string (必需)
名字 资源名称 string (必需)
性能 操作规则属性 ActionRuleProperties
标签 资源标记 标记名称和值的字典。 请参阅模板 中的 标记
类型 资源类型 “Microsoft.AlertsManagement/actionRules”

范围

名字 描述 价值
scopeType 目标范围的类型 “Resource”
“ResourceGroup”
“订阅”
给定范围类型的 ARM ID 列表,这些 ID 将是给定操作规则的目标。 string[]

抑制

名字 描述 价值
suppressionConfig 操作规则的抑制配置 SuppressionConfig (必需)
类型 指示操作规则的类型 “抑制”(必需)

SuppressionConfig

名字 描述 价值
recurrenceType 指定何时应应用抑制 “Always”
“每日”
“Monthly”
“Once”
“每周”(必需)
附表 抑制计划配置 SuppressionSchedule

SuppressionSchedule

名字 描述 价值
endDate 抑制结束日期 字符串
endTime 抑制结束日期 字符串
recurrenceValues 指定定期模式的值 int[]
startDate 抑制的开始日期 字符串
startTime 抑制的开始时间 字符串

快速入门模板

以下快速入门模板部署此资源类型。

模板 描述
使用 Azure Monitor 为备份警报 设置通知

部署到 Azure
通过此模板,可以使用 Azure Monitor 为恢复服务保管库设置电子邮件通知,方法是部署警报处理规则和操作组

Terraform (AzAPI 提供程序)资源定义

可以使用目标操作部署 actionRules 资源类型:

  • 资源组

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.AlertsManagement/actionRules 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.AlertsManagement/actionRules@2019-05-05-preview"
  name = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      conditions = {
        alertContext = {
          operator = "string"
          values = [
            "string"
          ]
        }
        alertRuleId = {
          operator = "string"
          values = [
            "string"
          ]
        }
        alertRuleName = {
          operator = "string"
          values = [
            "string"
          ]
        }
        description = {
          operator = "string"
          values = [
            "string"
          ]
        }
        monitorCondition = {
          operator = "string"
          values = [
            "string"
          ]
        }
        monitorService = {
          operator = "string"
          values = [
            "string"
          ]
        }
        severity = {
          operator = "string"
          values = [
            "string"
          ]
        }
        targetResourceType = {
          operator = "string"
          values = [
            "string"
          ]
        }
      }
      description = "string"
      scope = {
        scopeType = "string"
        values = [
          "string"
        ]
      }
      status = "string"
      type = "string"
      // For remaining properties, see ActionRuleProperties objects
    }
  })
}

ActionRuleProperties 对象

设置 类型 属性以指定对象的类型。

对于 ActionGroup,请使用:

{
  actionGroupId = "string"
  type = "ActionGroup"
}

对于 诊断,请使用:

{
  type = "Diagnostics"
}

对于 抑制,请使用:

{
  suppressionConfig = {
    recurrenceType = "string"
    schedule = {
      endDate = "string"
      endTime = "string"
      recurrenceValues = [
        int
      ]
      startDate = "string"
      startTime = "string"
    }
  }
  type = "Suppression"
}

属性值

ActionGroup

名字 描述 价值
actionGroupId 操作规则匹配时触发的操作组 string (必需)
类型 指示操作规则的类型 “ActionGroup”(必需)

ActionRuleProperties

名字 描述 价值
条件 将筛选警报的条件 条件
描述 操作规则的说明 字符串
范围 将应用操作规则的范围 范围
地位 指示给定的操作规则是启用或禁用的 “Disabled”
“Enabled”
类型 对于 ActionGroup类型,设置为“ActionGroup”。 对于诊断 类型,设置为“诊断”。 对于类型 抑制,设置为“抑制”。 “ActionGroup”
“诊断”
“抑制”(必需)

条件

名字 描述 价值
算子 给定条件的运算符 “Contains”
“DoesNotContain”
“Equals”
“NotEquals”
要匹配给定条件的值列表。 string[]

条件

名字 描述 价值
alertContext 按警报上下文筛选警报(有效负载) 条件
alertRuleId 按警报规则 ID 筛选警报 条件
alertRuleName 按警报规则名称筛选警报 条件
描述 按警报规则说明筛选警报 条件
monitorCondition 按监视条件筛选警报 条件
monitorService 按监视服务筛选警报 条件
严厉 按严重性筛选警报 条件
targetResourceType 按目标资源类型筛选警报 条件

诊断

名字 描述 价值
类型 指示操作规则的类型 “诊断”(必需)

ManagedResourceTags

名字 描述 价值

Microsoft.AlertsManagement/actionRules

名字 描述 价值
位置 资源位置 string (必需)
名字 资源名称 string (必需)
性能 操作规则属性 ActionRuleProperties
标签 资源标记 标记名称和值的字典。
类型 资源类型 “Microsoft.AlertsManagement/actionRules@2019-05-05-preview”

范围

名字 描述 价值
scopeType 目标范围的类型 “Resource”
“ResourceGroup”
“订阅”
给定范围类型的 ARM ID 列表,这些 ID 将是给定操作规则的目标。 string[]

抑制

名字 描述 价值
suppressionConfig 操作规则的抑制配置 SuppressionConfig (必需)
类型 指示操作规则的类型 “抑制”(必需)

SuppressionConfig

名字 描述 价值
recurrenceType 指定何时应应用抑制 “Always”
“每日”
“Monthly”
“Once”
“每周”(必需)
附表 抑制计划配置 SuppressionSchedule

SuppressionSchedule

名字 描述 价值
endDate 抑制结束日期 字符串
endTime 抑制结束日期 字符串
recurrenceValues 指定定期模式的值 int[]
startDate 抑制的开始日期 字符串
startTime 抑制的开始时间 字符串