Applies to: ✅ Azure Data Explorer
Learn how to set up your environment to use Kusto client libraries. You can use these libraries to create apps that connect with a cluster and run queries or ingest data.
In this article, you learn how to install client library packages for your preferred language.
Prerequisites
Select the prerequisites for the programming language used to create your app.
Note
Kusto client libraries are compatible with JavaScript and TypeScript. To convert TypeScript examples to JavaScript, simply remove the type annotations used for variables, parameters, and return values.
One or more of the following .NET SDK frameworks:
- .NET SDK 5.0 or later
- .NET Core 2.1 or later
- .NET Standard 2.1 or later
- .NET Framework 4.7.2 or later
Verify installation: In a command shell, run dotnet sdk check
to check that the versions installed meet the minimum requirements.
- Python 3.7 or later
- Ensure the
python
executable is in your PATH
- Verify installation: In a command shell, run
python --version
to check that the version is 3.7 or later
Node 16 or later built with ES6
- Ensure the
node
executable is in your PATH
- Verify installation: In a command shell, run
node --version
to check that the version is 3.7 or later
A Node.js app or a browser-based web app, such as a React app.
For browser-based web apps:
If your app has a login experience, you can use the @auzre/identity library to issue an authorization token and use withTokenProvider
to feed this token to the Kusto client:
const tokenProvider = () => Promise.resolve("someToken")
KustoConnectionStringBuilder.withTokenProvider(clusterUri, tokenProvider)
If your app doesn't have a login experience, or you prefer to use the Kusto client library to prompt authentication, you need to set up an application registration with the necessary permissions:
- Create a Microsoft Entra application registration.
- In the Authentication tab, select + Add a platform. Then, select Single-page application.
- Enter the desired Redirect URIs, select the boxes for Access tokens and ID tokens, and select Configure. For more information on redirect URIs, see Desktop app that calls web APIs.
- Configure delegated permissions for the application.
- Grant the application access to your database.
- In the Overview tab, copy the Application (client) ID.
The examples throughout the following tutorials use the Kusto client library to prompt authentication.
Note
If you belong to an organization, restrictions based on organization configurations might prevent you from authenticating. Ask for access from an organization admin or try again on a personal account.
- JDK 8 or later
- Ensure the
java
executable is in your PATH
- Verify installation: In a command shell, run
java -version
to check that the version is 8 or later
- Maven 3.6.3 or later
- Ensure the
mvn
executable is in your PATH
- Verify installation: In a command shell, run
mvn -version
to check that the version is 3.6.3 or later
Install the package
This section walks you through installing the Kusto client library in your environment.
The following table lists the client libraries and the corresponding package names.
Library Name |
Description |
Kusto Data library |
Provides a client for connecting to clusters. Use the client library to query data or run management commands. |
Kusto Ingest library |
Provides a client for ingesting data into clusters. For more information, see Kusto Ingest library overview into your cluster. |
Add the Kusto client libraries for your preferred language to your project, or use the package manager appropriate for your language to install the client libraries.
dotnet add package Microsoft.Azure.Kusto.Data --version 11.2.2
dotnet add package Microsoft.Azure.Kusto.Ingest --version 11.2.2
python -m pip install azure-kusto-data
python -m pip install azure-kusto-ingest
npm install azure-kusto-data
npm install azure-kusto-ingest
When creating apps, use the maven-archetype-quickstart Maven template for the package, as follows.
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId==my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
Then add the following dependencies to your pom.xml, replacing the artifact versions with the latest available on Maven Central for kusto-data and kusto-ingest.
<dependency>
<groupId>com.microsoft.azure.kusto</groupId>
<artifactId>kusto-data</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure.kusto</groupId>
<artifactId>kusto-ingest</artifactId>
<version>5.0.0</version>
</dependency>
You also need to add the maven-compiler-plugin and exec-maven-plugin plugins in your pom.xml. If they don't already exist, add them as follows.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
</plugin>
The Kusto SDKs contain quick start sample applications. These applications showcase how to authenticate, administer, query, and ingest data using the Kusto client libraries. You can use them as a starting point for your own application by modifying the code or incorporating specific sections into your project.
Learn how to create apps that use client libraries
The following articles walk you through creating apps that use the Kusto client libraries.
Related content