The `azure-kusto-ingest` library provides a client for ingesting data into Azure Data Explorer (Kusto) clusters. It supports queued ingestion (batching for high throughput) and streaming ingestion (low latency). The current version is 6.0.3, with frequent bug fix releases and occasional major versions aligning with Python and Azure SDK ecosystem changes. Version 6.0.3 introduced allowing transformation functions for CSV and SCSV formats.
pip install azure-kusto-ingestVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to perform queued ingestion of in-memory CSV data into an Azure Data Explorer table. It uses Azure CLI authentication for simplicity but can be adapted for other authentication methods. The example sets up the Kusto client, defines ingestion properties, and sends a small CSV string as a stream. Remember to set `KUSTO_CLUSTER_URL`, `KUSTO_DATABASE`, and `KUSTO_TABLE` environment variables.
Upgrade your Python environment to 3.9 or higher. If you must use an older Python version, pin `azure-kusto-ingest` to `<6.0.0` (e.g., `azure-kusto-ingest<6.0.0`).
Review your `KustoConnectionStringBuilder` usage. Use the builder methods (e.g., `with_aad_managed_identity`) instead of relying on parsing specific keyword arguments in the connection string directly. If using older keyword-based strings, downgrade to `<5.0.0`.
Always use the latest version of `azure-kusto-ingest` with the latest compatible Pandas version. If encountering issues, specifically check the changelog for fixes related to `dataframe_from_result_table` and `ingest_from_dataframe` in your library version relative to your Pandas version. Pinning `pandas` to a known working version might be necessary if unable to update `azure-kusto-ingest`.
Upgrade to version `6.0.1` or higher for improved throttling event handling in Managed Streaming. If using streaming ingestion, ensure your cluster is adequately scaled for the expected ingestion rate.
Update your code to import `KustoClient` instead of `KustoIngestClient`. For example, `from azure.kusto.ingest import KustoClient`. If you need to support older versions, consider conditional imports or pin the library to `<6.0.0`.
Update your code to import and use either `QueuedKustoIngestClient` or `StreamKustoIngestClient` from `azure.kusto.ingest` instead of `KustoIngestClient`. For example, change `from azure.kusto.ingest import KustoIngestClient` to `from azure.kusto.ingest import QueuedKustoIngestClient` or `StreamKustoIngestClient` and adjust the client instantiation accordingly.
Ensure the `azure-kusto-ingest` package is installed in the correct Python environment. If using a virtual environment, activate it before installing. For platforms like Databricks, ensure the library is installed for the cluster's Python environment. `pip install azure-kusto-ingest`
Check the official `azure-kusto-ingest` documentation for the correct import path of `DataFormat` in your installed version. It is often located in a submodule like `azure.kusto.data.data_format`. `from azure.kusto.data.data_format import DataFormat`
Verify that your Azure AD application or managed identity has the necessary 'Ingestor' permissions on the target database in Azure Data Explorer. Double-check the client ID, client secret (or certificate), tenant ID, and the Kusto cluster URI in your connection string.
Ensure the table name provided to the ingestion client is correct and that the table has been created in your Azure Data Explorer database. You can create a table using Kusto Query Language (KQL) commands in the Azure Data Explorer web UI or programmatically.
Review your data source and ensure its schema (column names, types, order) aligns with the target Kusto table's schema. If using ingestion mappings, verify they are correctly defined and reference the appropriate columns. For CSV files, ensure all rows have a consistent number of fields. You may need to modify your ingestion mapping or the table schema to align with the incoming data.