kusto-kql-api

Guides authoring, reviewing, and debugging KQL queries and Kusto REST API integrations.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/lurodrisilva/personal-skills --skill kusto-kql-api-lurodrisilva
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kusto-kql-api
Source: https://github.com/lurodrisilva/personal-skills/tree/main/platform-engineering/kusto-kql-api
Command: npx skills add https://github.com/lurodrisilva/personal-skills --skill kusto-kql-api-lurodrisilva

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams calling Kusto engines (Azure Data Explorer, Fabric Eventhouse, Log Analytics, Application Insights, Microsoft Sentinel) over REST or KQL hit silent failures: HTTP 200 responses that hide errors in the body, joins that silently deduplicate rows, and unvalidated queries that break in production. This Skill encodes the rules and API mechanics that prevent those traps. ## Core Features & Use Cases - REST surface reference: Covers the five engine endpoints (/v1/rest/{query,mgmt,ingest}, /v2/rest/query), service-specific base URLs and OAuth audiences, request body schema, and the full request-property catalogue (servertimeout, notruncation, query_datetimescope_*, request_readonly_hardline, cache controls). - v1 vs v2 response handling: Explains the v2 frame protocol (DataSetHeader, TableFragment with DataAppend/DataReplace, DataSetCompletion) and the three-layer error model, including the "200 OK with errors in body" trap. - KQL language guidance: Operator and aggregation catalogue, join kinds with the innerunique default trap, time-series functions, and performance heuristics like has vs contains. - Parser and SDK coverage: Documents Microsoft.Azure.Kusto.Language for CI syntax validation and the cross-language SDK family (azure-kusto-data, azure-monitor-query, .NET SDKs). - Use Case: A CI pipeline parses every checked-in .kql file with KustoCode.ParseAndAnalyze and fails the build on syntax errors, while production scripts set x-ms-client-request-id and check DataSetCompletion.HasErrors on every call. ## Quick Start Ask the assistant to review your KQL query or Kusto REST client code against the ten non-negotiable rules in this skill.

Frequently Asked Questions about kusto-kql-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Log Analytics from a script using the REST API?▼

Send a POST to https://api.loganalytics.io/v1/workspaces/{workspaceId}/query with a body containing the query and timespan, plus an Azure AD bearer token for the api.loganalytics.io audience. Acquire the token via MSAL or az account get-access-token.

What is the difference between Kusto v1 and v2 query APIs?▼

The v1 endpoint /v1/rest/query returns one buffered object with a Tables array, while /v2/rest/query returns a frame protocol with DataSetHeader, DataTable or TableFragment frames, and DataSetCompletion. V2 supports progressive streaming via results_progressive_enabled and is recommended for new code.

Why does my Kusto query return 200 OK but no data?▼

Kusto can return HTTP 200 with errors embedded in the response body. Always inspect DataSetCompletion.HasErrors and the OneApiErrors payload, since clients that check only the HTTP status code miss in-band query failures.

Why does my KQL join silently drop rows?▼

The default join kind in KQL is innerunique, which deduplicates the left side by join keys before joining. Declare kind= explicitly on every join, such as kind=inner or kind=leftouter, to avoid silent data loss.

How do I validate KQL syntax in CI without a server?▼

Use the Apache-2.0 NuGet package Microsoft.Azure.Kusto.Language. Call KustoCode.Parse for syntax-only checks or KustoCode.ParseAndAnalyze with a GlobalState schema for semantic validation, then fail the build on any diagnostics.

Does this skill cover streaming ingestion to Kusto?▼

Only partially. The auth and endpoint sections apply, including the ingest- host prefix for the Data Management endpoint, but queued and streaming ingestion pipelines are out of scope and belong in a separate skill.