【问题标题】:Can't see the alerts I created on Azure Portal看不到我在 Azure 门户上创建的警报
【发布时间】:2018-08-28 14:11:05
【问题描述】:

我正在 Azure 门户上的 Application Insights 中创建警报,但由于某种原因我无法看到它们。我知道警报有效,因为我收到了预期的电子邮件。

使用管理 API 我可以看到警报:

GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{scheduleQueryName}?api-version=2018-04-16

是什么阻止了它们出现在门户上?这是我的 ARM 模板

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "appInsightsName": {
      "type": "string"
    },
    "alertEmail": {
      "type": "string"
    },
    "utilityActionGroup": {
      "type": "string"
    },
    "scheduleQueryName": {
      "type": "string"
    },
    "monitoringUtilityAlertEnabled": {
      "type": "string"
    }
  },
  "variables": {},
  "resources": [
    {
      "apiVersion": "2014-04-01",
      "name": "[parameters('appInsightsName')]",
      "type": "Microsoft.Insights/components",
      "location": "[resourceGroup().location]",
      "properties": {
        "applicationId": "[parameters('appInsightsName')]"
      }
    },
    {
      "type": "Microsoft.Insights/actionGroups",
      "name": "[parameters('utilityActionGroup')]",
      "apiVersion": "2018-03-01",
      "location": "Global",
      "properties": {
        "groupShortName": "Utility",
        "enabled": true,
        "emailReceivers": [
          {
            "name": "AlertEmail",
            "emailAddress": "[parameters('alertEmail')]"
          }
        ]
      },
      "dependsOn": []
    },
    {      
      "type": "Microsoft.Insights/scheduledQueryRules",
      "name": "[parameters('scheduleQueryName')]",
      "apiVersion": "2018-04-16",
      "location": "[resourceGroup().location]",
      "tags": {
        "[concat('hidden-link: ', resourceId('Microsoft.Insights/components', parameters('appInsightsName')))]": "Resource"
      },
      "scale": null,
      "properties": {
        "description": "Sends an alert when the utility stops sending a trace to app insights",
        "enabled": "[parameters('monitoringUtilityAlertEnabled')]",
        "source": {
          "query": "traces\n| where message == \"Utility Service is alive\"  | where timestamp >= ago(30m) ",
          "authorizedResources": [],
          "dataSourceId": "[resourceId('microsoft.insights/components', parameters('appInsightsName'))]",
          "queryType": "ResultCount"
        },
        "schedule": {
          "frequencyInMinutes": 5,
          "timeWindowInMinutes": 5
        },
        "action": {
          "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction",
          "severity": "2",
          "aznsAction": {
            "actionGroup": [ "[resourceId('microsoft.insights/actionGroups', parameters('utilityActionGroup'))]" ],
            "emailSubject": "Monitoring Utility Stopped working"
          },
          "trigger": {
            "thresholdOperator": "Equal",
            "threshold": 0
          }
        }
      },
      "dependsOn": [
        "[resourceId('microsoft.insights/components', parameters('appInsightsName'))]",
        "[resourceId('microsoft.insights/actionGroups', parameters('utilityActionGroup'))]"
      ]
    }
  ],
  "outputs": {  }
}

【问题讨论】:

  • 首先您说您正在“在 Azure 门户上创建警报...”,然后您说您有一个 ARM 模板。当问题发生时,你能澄清一下你创建它们的方式吗?我只有在使用 ARM 模板时才会遇到这个问题。

标签: azure azure-application-insights azureportal


【解决方案1】:

根据我的测试,我通过 azure 门户在应用程序洞察力中创建警报,它可以出现在门户中。

在门户中查看警报时,请确保选择正确的资源作为您创建警报的资源。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-07-15
    • 2019-07-04
    • 1970-01-01
    • 2019-01-07
    • 2019-08-17
    • 1970-01-01
    • 2012-08-20
    • 1970-01-01
    相关资源
    最近更新 更多