properties.search.query无效的日志或指标查询

时间:2019-01-25 11:51:14

标签: azure azure-template

我有一个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)]"
},

这是一个为某些应用程序见解项目设置警报的循环。这部分有错误吗?

1 个答案:

答案 0 :(得分:1)

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