Skip to content

Instantly share code, notes, and snippets.

@johnciocoiu
johnciocoiu / azure-function-errored-requests-with-traces.kql
Created October 15, 2025 08:18
Azure Application Insights query for Azure Function errored requests with joined traces
requests
| project timestamp, operation_Id, operation_Name, resultCode, url, client_IP, success
| join (
traces
| project timestamp, operation_Id, message
)
on operation_Id
| where resultCode startswith "4" or resultCode startswith "5" or success == False
| summarize Traces = make_list(message), Time = max(timestamp) by resultCode, operation_Name, operation_Id, url, client_IP, success
| project Time, operation_Name, resultCode, success, Traces, operation_Id, client_IP, url