该查询在分析门户网站上工作正常,但在Logic应用程序中的“可视化分析查询”下却无法正常工作。我也不确定如何告诉逻辑应用程序在特定数据源上进行查询。我在下面查询:
requests
| where timestamp > ago(20m)
| summarize failedCount=sumif(itemCount, success == false and (client_Type != "Browser")), impactedUsers=dcountif(user_Id, success == false and (client_Type != "Browser")), totalCount=sum(itemCount) by operation_Name
| union(requests
| summarize failedCount=sumif(itemCount, success == false and (client_Type != "Browser")), impactedUsers=dcountif(user_Id, success == false and (client_Type != "Browser")), totalCount=sum(itemCount)
| extend operation_Name="Overall")
| where failedCount > 0
| order by failedCount desc
我在逻辑应用程序中遇到以下错误:
“消息”:“ Microsoft.ApplicationInsights.DraftClient.Exceptions.DraftApiQueryFailedException:无法查询草稿API。状态代码:找不到,内容:{\”错误\“:{\”消息\“:\”该应用程序可以找不到\“,\”代码\“:\” ApplicationNotFoundError \“
答案 0 :(得分:0)
我有同样的问题。问题在于逻辑应用程序和应用程序见解之间的联系,而不是查询本身。
我使用PowerShell创建了密钥:
$ApplicationInsightsAPI = New-AzApplicationInsightsApiKey -ResourceGroupName $ResourceGroupName -Name $ApplicationInsightsName -Permissions ReadTelemetry -Description "$ConnectionNameAI"
然后,我使用$ApplicationInsightsAPI
并将ID
和ApiKey
属性传递给连接创建命令:
$connection = New-azResource -Properties @{"api" = @{"id" = "subscriptions/" + $subscriptionId + "/providers/Microsoft.Web/locations/" + $ResourceLocation + "/managedApis/" + $api}; "displayName" = $ConnectionNameAI; "parameterValues"= @{"username" = $ApplicationInsightsAPI.Id; "password" = $ApplicationInsightsAPI.ApiKey;} } -ResourceName $ConnectionNameAI -ResourceType "Microsoft.Web/connections" -ResourceGroupName $ResourceGroupName -Location $ResourceLocation -Force
但这是不正确。 “用户名”应该是Application Insights的应用程序ID,而不是API密钥的ID。