Skip to content

Instantly share code, notes, and snippets.

View logic-apps-instances-log-analytics.kql
AppTraces
| where OperationName == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(Properties.prop__properties)).resource))
| project TimeGenerated
, LogicApp = tostring(AppRoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowRunId = tostring(resource.runId)
, ClientTrackingId = tostring(Properties.prop__clientTrackingId)
, WorkflowStatus = tostring(Properties.prop__status)
| sort by TimeGenerated desc
View logic-app-instances-app-insights.kql
// Logic App instances with workflow run id, client tracking id, and workflow final status.
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowRunId = tostring(customDimensions.prop__flowRunSequenceId)
, ClientTrackingId = tostring(customDimensions.prop__clientTrackingId)
, WorkflowStatus = customDimensions.prop__status
View logic-app-failed-trigger-details-app-insights.kql
traces
| where customDimensions.EventName == "WorkflowTriggerEnd"
| where customDimensions.prop__status == "Failed"
| sort by timestamp desc
| extend properties = parse_json(tostring(customDimensions.prop__properties))
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| extend error = parse_json(tostring(customDimensions.prop__error))
| sort by timestamp desc
| project timestamp
, LogicApp = tostring(cloud_RoleName)
View logic-app-failed-trigger-count-app-insights.kql
traces
| where customDimensions.EventName == "WorkflowTriggerEnd"
| where customDimensions.prop__status == "Failed"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
| summarize Count = count()
by bin(timestamp, 1d),
Workflow
View logic-app-failed-count-app-insights.kql
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowStatus = tostring(customDimensions.prop__status)
| where WorkflowStatus == "Failed"
| summarize Count = count()
by bin(timestamp, 1d)
View logic-app-failed-instances-app-insights.kql
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| extend error = parse_json(tostring(customDimensions.prop__error))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowRunId = tostring(customDimensions.prop__flowRunSequenceId)
, ClientTrackingId = tostring(customDimensions.prop__clientTrackingId)
, WorkflowStatus = customDimensions.prop__status
View logic-app-tracked-properties-app-insights.kql
// Logic App instances with workflow final status, workflow run id, client tracking id, and tracked properties.
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowRunId = tostring(customDimensions.prop__flowRunSequenceId)
, ClientTrackingId = tostring(customDimensions.prop__clientTrackingId)
, WorkflowStatus = customDimensions.prop__status
View user-updated-pub.json
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each_message_in_batch": {
"actions": {
"Parse_message": {
"description": "Parse each individual record",
"inputs": {
"content": "@items('For_each_message_in_batch')",
View cicd-logicapp-armreadytodeploy.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
// ARM Template Parameters Definition
"parameters": {
"logicAppName": {
"type": "string"
},
"servicebus_1_Connection_Name": {
"type": "string",
View logic-apps-workflows-by-status-count-app-insights.kql
traces
| where operation_Name == "FlowRunLastJob"
| extend resource = parse_json(tostring(parse_json(tostring(customDimensions.prop__properties)).resource))
| project timestamp
, LogicApp = tostring(cloud_RoleName)
, Workflow = tostring(resource.workflowName)
, WorkflowStatus = tostring(customDimensions.prop__status)
| where WorkflowStatus == "Failed"
| summarize Count = count()
by bin(timestamp, 1d)