Install & Compatibility
Where this runs
tested against v4.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.660s · 45.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.8s · import 0.588s · 46MB
45MB installed
● package 45MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
KustoManagementClient
✓ from azure.mgmt.kusto import KustoManagementClient
✗ from azure.mgmt.kusto.kusto_management_client import KustoManagementClient
The direct import path for KustoManagementClient changed in breaking versions (e.g., v3.0.0) for consistency with new SDK guidelines.
models
✓ from azure.mgmt.kusto.models import Cluster
✗ import azure.mgmt.kusto.models.cluster
Model imports should use 'from azure.mgmt.kusto.models import ...' rather than direct attribute access on the models module.
This quickstart demonstrates how to authenticate with `DefaultAzureCredential` and instantiate the `KustoManagementClient`. It then shows how to list Kusto clusters within a specified resource group. Ensure that the required environment variables (`AZURE_SUBSCRIPTION_ID`, and optionally `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `KUSTO_RESOURCE_GROUP_NAME`) are set for successful execution.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.kusto import KustoManagementClient
# Set environment variables for authentication and subscription ID
# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET (for service principal)
# AZURE_SUBSCRIPTION_ID
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "YOUR_SUBSCRIPTION_ID")
if not subscription_id or subscription_id == "YOUR_SUBSCRIPTION_ID":
raise ValueError("AZURE_SUBSCRIPTION_ID environment variable not set or is a placeholder.")
# Authenticate using DefaultAzureCredential. This credential will attempt
# to use various authentication methods, such as environment variables,
# managed identity, or Azure CLI, in a prioritized order.
credential = DefaultAzureCredential()
# Create Kusto Management Client
client = KustoManagementClient(credential=credential, subscription_id=subscription_id)
# Example: List Kusto Clusters in a resource group
# Replace 'YOUR_RESOURCE_GROUP' with an actual resource group name where Kusto clusters exist.
resource_group_name = os.environ.get("KUSTO_RESOURCE_GROUP_NAME", "YOUR_RESOURCE_GROUP")
if not resource_group_name or resource_group_name == "YOUR_RESOURCE_GROUP":
print("Warning: KUSTO_RESOURCE_GROUP_NAME environment variable not set or is a placeholder. Skipping cluster listing example.")
else:
print(f"Listing Kusto clusters in resource group: {resource_group_name}")
try:
for cluster in client.clusters.list_by_resource_group(resource_group_name):
print(f"- {cluster.name} (Location: {cluster.location}, SKU: {cluster.sku.name})")
except Exception as e:
print(f"Error listing clusters: {e}. Ensure the resource group exists and you have permissions.")
Debug
Known issues
breakingThe credential system was completely revamped in versions around 1.0.0b1/3.0.0. Old `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported. Use classes from `azure-identity` (e.g., `DefaultAzureCredential`). The client constructor parameter `credentials` was renamed to `credential`.fixInstall `azure-identity` (`pip install azure-identity`) and update your authentication code to use `DefaultAzureCredential` or other `azure-identity` classes. Change `credentials=` to `credential=` when instantiating the client.
affects: >=1.0.0b1, >=3.0.0
breakingImport paths for the client and model classes changed significantly with versions around 1.0.0b1/3.0.0. `KustoManagementClient` can no longer be imported from `azure.mgmt.kusto.kusto_management_client`. Similarly, models cannot be imported via direct attribute access like `azure.mgmt.kusto.models.my_class`.fixImport `KustoManagementClient` directly from the top-level package: `from azure.mgmt.kusto import KustoManagementClient`. Import model classes from the `azure.mgmt.kusto.models` submodule: `from azure.mgmt.kusto.models import Cluster`.
affects: >=1.0.0b1, >=3.0.0
breakingOperations that used to return a `msrest.polling.LROPoller` now return `azure.core.polling.LROPoller` and are typically prefixed with `begin_`. The exception hierarchy has also been simplified, with most exceptions now being `azure.core.exceptions.HttpResponseError` (the `CloudError` class has been removed).fixAdjust code to use the `begin_` prefix for long-running operations and handle `azure.core.exceptions.HttpResponseError` for general API errors.
affects: >=1.0.0b1, >=3.0.0
gotchaSupport for Python 2.7 for Azure SDK Python packages ended on January 1, 2022. This library, `azure-mgmt-kusto`, requires Python 3.8 or newer.fixEnsure your development and deployment environments use Python 3.8 or a later version.
affects: <3.8
gotchaFor `DefaultAzureCredential` to authenticate correctly outside of Azure-hosted environments (like local development without Managed Identity), specific environment variables must be configured: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` for service principal authentication, and `AZURE_SUBSCRIPTION_ID` for the client to target a subscription.fixSet the required environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, and `AZURE_SUBSCRIPTION_ID`. Refer to the `azure-identity` documentation for alternative authentication flows (e.g., Azure CLI, Managed Identity).
affects: All versions using `azure-identity`
Upgrade
Version history
4.0.0latest on PyPI · released Jun 24, 2026
Audit
Dependencies
azure-identityrequiredRequired for Azure Active Directory token authentication.
PythonrequiredRequires Python version 3.8 or greater.