Azure Logic App Application Insights 电子邮件失败

Azure Logic App Application Insights email failing

我正在配置 Azure 逻辑应用程序以提供来自 Application Insights 的每日摘要。

我 运行 的查询在 Application Insights 指标资源管理器中运行良好。

我要求应用以 Html table 的形式提供查询结果。

失败并出现以下响应:

Headers:

{
  "Pragma": "no-cache",
  "Timing-Allow-Origin": "*",
  "Cache-Control": "no-cache",
  "Date": "Thu, 13 Jul 2017 07:33:15 GMT",
  "Server": "Microsoft-IIS/8.0,Microsoft-HTTPAPI/2.0",
  "X-AspNet-Version": "4.0.30319",
  "X-Powered-By": "ASP.NET",
  "Content-Length": "2197",
  "Content-Type": "application/json",
  "Expires": "-1"
}

Body:

{
  "error": {
    "code": 500,
    "message": "\"Microsoft.ApplicationInsights.DraftClient.Exceptions.FailedToParseDraftQueryResponseException: Failed to convert table (JToken) to Table object ---> System.ArgumentException: Can not convert Null to Int32.\r\n   at Newtonsoft.Json.Linq.JToken.op_Explicit(JToken value)\r\n   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)\r\n   at Microsoft.ApplicationInsights.DraftClient.Helpers.DraftResponseParser.ConvertToTable(JToken token)\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.ApplicationInsights.DraftClient.Helpers.DraftResponseParser.ConvertToTable(JToken token)\r\n   at Microsoft.ApplicationInsights.DraftClient.Helpers.DraftResponseParser.ParseDraftQueryResponse(String draftQueryResponseInJson)\r\n   at Microsoft.ApplicationInsights.DraftClient.DraftApiClient.<ExecuteQueryAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Microsoft.ApplicationInsights.DraftClient.DraftApiClient.<ExecuteQueryAsync>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at DraftFlowConnector.VisualizeDraftResults.<RunAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at DraftFlowConnector.VisualizeDraftResults.<RunAsync>d__5.MoveNext()\""
  }
}

我可以自己解决这个问题吗?

似乎失败与尝试将数字列(具有空值)转换为 'Int' 类型有关。

我们将解决此问题,同时,您可以通过向查询添加 'where' 语句来解决此问题,该语句会过滤掉相关数字中包含空值的行列,类似于:

| where tostring(columnName) != ""

谢谢!