Connect to Azure Data Explorer with ODBC
Open Database Connectivity (ODBC) is a widely accepted application programming interface (API) for database access. Azure Data Explorer is compatible with a subset of the SQL Server communication protocol (MS-TDS). This compatibility enables the use of the ODBC driver for SQL Server with Azure Data Explorer.
Consequently, you can establish a connection to Azure Data Explorer from any application that is equipped with support for the ODBC driver for SQL Server.
Watch the following video to learn to create an ODBC connection.
Alternatively, follow the steps to connect to your cluster with ODBC.
Note
We recommend using dedicated connectors whenever possible. For a list of available connectors, see Connectors overview.
Prerequisites
- Microsoft ODBC Driver for SQL Server version 17.2.0.1 or later for your operating system.
Connect to your cluster with ODBC
You can connect to your cluster in the following ways.
From an application that supports ODBC connection, you can connect to your cluster with a connection string of the following format:
"Driver={ODBC Driver 17 for SQL Server};Server=mykustocluster.kusto.windows.net;Database=mykustodatabase;Authentication=ActiveDirectoryIntegrated"
Note
Azure Data Explorer considers string values as NVARCHAR(MAX)
, which may not work well with some ODBC applications. Cast the data to NVARCHAR(
n)
using the Language
parameter in the connection string. For example, Language=any@MaxStringSize:5000
will encode strings as NVARCHAR(5000)
. For more information, see tuning options.
Application authentication
To use application principal authentication with ODBC, you must provide the Microsoft Entra tenant ID. You can set this configuration in the connection string, the Windows registry, or the odbc.ini file. See examples in the following tabs. For more information, see tuning options.
Set the application principal with Language=any@AadAuthority:<aad_tenant_id>
in the connection string. Replace <aad_tenant_id>
, <aad_application_id>
, and <aad_application_secret>
with the Microsoft Entra tenant ID, Microsoft Entra application ID, and the Microsoft Entra application secret respectively.
"Driver={ODBC Driver 17 for SQL Server};Server=<adx_cluster_name>.<region_name>.kusto.windows.net;Database=<adx_database_name>;Authentication=ActiveDirectoryServicePrincipal;Language=any@AadAuthority:<aad_tenant_id>;UID=<aad_application_id>;PWD=<aad_application_secret>"
Related content
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for