azure - 来自 Kusto 查询的连接器名称

标签 azure azure-logic-apps kql azure-log-analytics azure-diagnostics

我对 Kusto 查询的语法非常陌生。我的目标是创建一个 kusto 查询来检索哪个逻辑应用程序出现系统错误以及错误所在的操作。另外,我想知道这个失败的操作属于哪个连接器。例如,如果“移动电子邮件”操作失败,我希望获得连接器名称(在本例中为 Office 365 Outlook 或类似名称),以便对操作进行分类。

我实现此目标的查询基于表“AzureDiagnostics”:

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.LOGIC"
| where Category == "WorkflowRuntime"
| where status_s == "Failed"
| where code_s  !has 'ActionFailed'
| where OperationName has "workflowActionCompleted" or OperationName has "workflowTriggerCompleted"
| extend ResourceName = coalesce(resource_actionName_s, resource_triggerName_s)
| extend ResourceCategory = substring(OperationName, 34, strlen(OperationName) - 43)
| project
    LogicAppName = resource_workflowName_s,
    ResourceCategory,
    ResourceName,
    LogicAppId = resource_runId_s,
    ErrorCode = code_s,
    ErrorMessage  = error_message_s,
    ErrorTime = format_datetime(startTime_t,'dd.MM.yyyy')

连接器名称使我能够对失败的逻辑应用进行分类,这样我就可以创建一个报告来显示我们遇到问题的连接器类型。

预先感谢您的帮助或其他解决方法来对失败的逻辑应用进行分类。

最佳答案

从我们这边复制后,解决方法之一是我们可以使用以下查询获取失败步骤的操作名称以及状态。

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.LOGIC"
| where Category == "WorkflowRuntime"
| where status_s == "Failed"
| extend Status = code_s
| project
    LogicAppName = resource_workflowName_s,
    ResourceRunID = resource_runId_s,
    Operation = OperationName,
    ActionName = coalesce(resource_actionName_s, resource_triggerName_s),
    Status

结果:

enter image description here

更新答案

没有直接的方法来获取连接器的名称。解决方法之一是使用跟踪属性来保存连接器名称并通过日志检索它。这不是一个完美的方法,但这是实现要求的解决方法之一。

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.LOGIC"
| where OperationName == "Microsoft.Logic/workflows/workflowActionCompleted"
| where status_s == "Failed"
| extend Status = code_s
| project
    LogicAppName = resource_workflowName_s,
    ResourceRunID = resource_runId_s,
    Operation = OperationName,
    ActionName = coalesce(resource_actionName_s, resource_triggerName_s),
    Status,
    ConnectorName = trackedProperties_ConnectorName_s

enter image description here

下面是我的逻辑应用程序中的流程

enter image description here

运行失败

enter image description here

在日志中

enter image description here

关于azure - 来自 Kusto 查询的连接器名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73061911/

相关文章:

azure - 如何使用 'Create container group' 操作将私有(private) docker hub 镜像部署到 Azure 逻辑应用

regex - Azure Kusto - 解析正则表达式的使用位置 - 不区分大小写

azure - 直接连接到 SQL Azure 与通过 API 服务层连接?

azure - 如何在 Azure Function App 中获取资源组列表

azure - 通过 Azure 逻辑应用从 Azure 容器中上次修改的文件夹中获取 Blob 内容

python - 检查 SharePoint 中的文件是否已完成上传

azure - 如何在具有后续提示的 QnA 问题中实现卡片并在卡片中使用它们

python - 如何使用 Python 中的 Rest API 进行身份验证并从 Azure 数据目录获取目录

azure - 需要一个 KQL 查询来比较今天在特定时间失败的 API 计数与昨天同一时间失败的 API 计数

azure - 日期时间语法似乎有效,但会导致语法错误