Skip to content
russ.tools

Azure KQL Query Builder help

Guidance from this tool's documentation.

Quick start

The page opens on a working query (failed Entra ID sign-ins the first time, and wherever you left off after that).

  1. Select the Scenario field, or press /, and search: a service, a table name or a word such as "failed" or "WAF".
  2. Pick a Time range with the 1h, 24h, 7d and 30d buttons, or choose another under Other.
  3. Add filters with the column buttons under Filters. The query and the sentence above it change as you type.
  4. Select Copy query and paste it into the Logs blade of your Log Analytics workspace.

There is no Generate button and nothing is sent anywhere: the query is built in your browser and is never run.

What it covers

34 services and 181 scenarios:

  • Azure Firewall (Network): AZFWNetworkRule, AZFWApplicationRule, AZFWDnsQuery, AZFWThreatIntel, AZFWIdpsSignature, AZFWNatRule
  • Application Gateway (Network): AGWAccessLogs, AGWFirewallLogs, AzureDiagnostics
  • VNet flow logs (Network): NTANetAnalytics
  • Front Door (Network): AzureDiagnostics
  • DNS query logs (Network): DNSQueryLogs
  • Bastion (Network): MicrosoftAzureBastionAuditLogs
  • Entra ID sign-ins (Identity): SigninLogs, AADNonInteractiveUserSignInLogs, AADManagedIdentitySignInLogs, AADServicePrincipalSignInLogs
  • Entra ID audit log (Identity): AuditLogs
  • Entra ID Protection (Identity): AADUserRiskEvents, AADRiskyUsers
  • Microsoft Graph activity (Identity): MicrosoftGraphActivityLogs
  • Sentinel and Defender alerts (Security): SecurityIncident, SecurityAlert
  • Windows security events (Security): SecurityEvent
  • Firewalls and appliances (CEF) (Security): CommonSecurityLog
  • Defender XDR (Security): DeviceLogonEvents, DeviceProcessEvents, DeviceNetworkEvents, EmailEvents, IdentityLogonEvents
  • Microsoft 365 activity (Microsoft 365): OfficeActivity
  • Intune (Microsoft 365): IntuneAuditLogs, IntuneDevices, IntuneOperationalLogs
  • Activity log (Platform): AzureActivity
  • Key Vault (Platform): AZKVAuditLogs
  • Storage (Platform): StorageBlobLogs, StorageFileLogs, StorageQueueLogs, StorageTableLogs
  • Log Analytics workspace (Platform): Usage, LAQueryLogs
  • Azure SQL (Data): SQLSecurityAuditEvents
  • Cosmos DB (Data): CDBDataPlaneRequests
  • Azure Backup (Data): AddonAzureBackupJobs
  • App Service (Compute): AppServiceHTTPLogs, AppServiceConsoleLogs, AppServiceAppLogs
  • Kubernetes (AKS) (Compute): ContainerLogV2, KubeEvents, KubePodInventory, AKSAudit, KubeNodeInventory, AKSControlPlane
  • Azure Virtual Desktop (Compute): WVDConnections, WVDErrors
  • Virtual machines (Compute): Heartbeat, Perf, Update
  • Windows event log (Compute): Event
  • Linux syslog (Compute): Syslog
  • Application Insights (Applications): AppRequests, AppExceptions, AppDependencies, AppTraces
  • API Management (Applications): ApiManagementGatewayLogs
  • Azure Functions (Applications): FunctionAppLogs
  • Container Apps (Applications): ContainerAppConsoleLogs, ContainerAppSystemLogs
  • Container Registry (Applications): ContainerRegistryLoginEvents

Scenarios come in three shapes: rows (newest first, or slowest first), top-N summaries (counts by caller, by rule, by status), and time charts (a count per bucket, with the bucket sized to the time range).

Table and column names are taken from Microsoft's Azure Monitor table reference. A table only holds data if the matching diagnostic setting, data collection rule or Sentinel connector sends it to your workspace, so an empty result usually means the log is not being collected, not that the query is wrong.

Reading and steering the query

  • Every line of the query is a control. Select a line, or tab to it and press Enter, to jump to what wrote it: the scenario, the time range, a filter, the row limit or the summary.
  • A line that has just changed is highlighted for a moment.
  • On a tall desktop window the query stays pinned while you scroll through the filters.

Summarise

Count by… turns any scenario into a count grouped by up to four columns of your choosing, and Over time turns it into a time chart. Reset goes back to the scenario's own output. Your filters and time range stay as they are.

Filters

A filter is one column, one operator and a value. What you can choose depends on the column's type:

  • Text: is, is not, equals in any case, contains, does not contain, has the term, starts with, ends with, is one of, is none of, matches regex, is empty, is not empty.
  • IP address: is and is not take an address or a CIDR range (10.0.0.0/8), and a range becomes ipv4_is_in_range. Is one of takes a list of addresses and ranges. Is a private address and is a public address need no value. IPv6 addresses and ranges work for is and is not.
  • Port and number: equals, not equals, greater or less than, between, and is one of. A port must be 0 to 65535.
  • One of a set: columns with a documented set of values offer them as a list, and compare without regard to case.
  • True or false and date and time columns have their own operators. Dates are UTC.

For is one of and is none of, separate values with commas or new lines.

A value that is not valid for its column says why underneath, and that filter is left out of the query until it is fixed, so what you copy always parses. Values are escaped for you: quotes and backslashes in a value cannot break out of the string.

The switch at the start of a filter takes it out of the query without deleting it, so you can compare with and without.

Filters marked from the scenario are what make the scenario what it is (for example Action == "Deny" in Top denied flows). You can change or remove them like any other.

Time range

  • 1h, 24h, 7d, 30d and the other ranges from 15 minutes to 90 days write TimeGenerated > ago(...).
  • Custom range (UTC) writes TimeGenerated between (datetime(...) .. datetime(...)).
  • Set in the portal writes no time filter, so the time picker in the Logs blade decides.

Write KQL

Write KQL is a plain editor with the same highlighting, copy, save and download. Use Edit as KQL on a built query to carry it across and change it by hand. Nothing you write there is checked or altered. Going back to Build keeps both.

Saved and recent

  • Save keeps the query under a name, with its filters, so it reopens in the builder. Rename or delete it from the list; a delete can be undone from the notice that appears.
  • Recent records each query you copy or download, newest first, up to 50.
  • The page also remembers the query you were last building.
  • Both lists are kept in this browser only. Use the Saved data page to clear them.
  • Favourites, history and custom templates from the earlier version of this tool are carried over the first time you open it. Custom templates become saved KQL queries.

Share Configuration, beside Help, copies a link that reopens the same service, scenario, time range, rows and filters, or the KQL you wrote. Everything in the link is in the address itself, so check the filter values before sending it to someone.

/azure-kql/<service> opens a service and /azure-kql/<service>/<scenario> opens one scenario, for example /azure-kql/entra-sign-ins/failed.

What it does not do

  • It does not run queries or connect to Azure.
  • It does not open the query in the portal. Microsoft publishes no link format for the Logs blade, and the ones the portal generates need your workspace's resource ID, so copy and paste is the reliable route.
  • It does not cover NSG flow logs in AzureNetworkAnalytics_CL, which is outside the table reference. VNet flow logs are covered.

Troubleshooting

  • "Failed to resolve table" in Log Analytics: the table does not exist in that workspace yet. Enable the resource-specific log category on the resource.
  • No rows: widen the time range, remove filters one at a time, and check the casing of exact-match values. Text comparisons with "is" are case-sensitive; "equals (any case)" and "contains" are not.
  • A filter is missing from the query: look for the message under it.
  • An old link opens with a filter flagged: the earlier version accepted values the table does not have. Change or remove the flagged filter.

Back to Azure KQL Query Builder