properties.search.query 不是有效的日志或指标查询

properties.search.query is not a valid log or metric query

我有一个 Azure 资源管理器模板,当我尝试部署它时经常出现奇怪的错误,但现在总是出现。我的直觉是这几天前就开始了,但我不确定原因是什么。大多数情况下,部署以错误消息结束:

"error": {
  "code": "properties.search.query is not a valid log or metric query.An error occurred while sending the request.",
  "message": {
    "lang": "en-US",
    "value": "properties.search.query is not a valid log or metric query.An error occurred while sending the request."
  },
  "innererror": {
    "stacktrace": "System.ArgumentException: properties.search.query is not a valid log or metric query.An error occurred while sending the request.\r\n   at Microsoft.AppInsights.Nexus.ResourceProvider.Validation.Ensure.IsTrue(Boolean value, String message)…

这并没有说明什么:-(我注意到如果我从我的模板中删除这一部分,它们的部署工作正常:

{
  "name": "[concat('ExceptionOccured ', variables('insightsNames')[copyIndex()])]",
  "apiVersion": "2018-04-16",
  "type": "Microsoft.Insights/scheduledQueryRules",
  "location": "East US",
  "tags": {
    "[concat('hidden-link:', resourceId('microsoft.insights/components', variables('insightsNames')[copyIndex()]))]": "Resource"
  },
  "properties": {
    "description": "Some exception has been logged.",
    "enabled": "true",
    "source": {
      "query": "exceptions",
      "authorizedResources": [],
      "dataSourceId": "[resourceId('microsoft.insights/components', variables('insightsNames')[copyIndex()])]",
      "queryType": "ResultCount"
    },
    "schedule": {
      "frequencyInMinutes": 60,
      "timeWindowInMinutes": 60
    },
    "action": {
      "severity": "1",
      "status": "Active",
      "aznsAction": {
        "actionGroup": [
          "[resourceId('microsoft.insights/actionGroups', variables('alertGroupName'))]"
        ]
      },
      "trigger": {
        "thresholdOperator": "GreaterThan",
        "threshold": 0,
        "consecutiveBreach": 1
      },
      "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction"
    }
  },
  "dependsOn": [
    "[resourceId('microsoft.insights/components', variables('insightsNames')[copyIndex()])]",
    "[resourceId('microsoft.insights/actionGroups', variables('alertGroupName'))]"
  ],
  "copy": {
    "name": "insightscopy",
    "count": "[length(variables('insightsNames'))]"
  },
  "condition": "[greater(length(parameters('alertEmail')), 0)]"
},

这是为某些应用洞察项目设置警报的循环。这部分有错误吗?

我昨天也开始收到这个。相同的警报结构,相同的错误。大约 30 分钟后,我尝试了它,但效果很好。不是你想听的,但我也找不到原因。