Registry / azure / azure-mgmt-kusto

azure-mgmt-kusto

JSON →
library4.0.0pypypi✓ verified 23d ago

The `azure-mgmt-kusto` library is the Microsoft Azure Kusto Management Client Library for Python, used to programmatically manage Azure Kusto (Azure Data Explorer) clusters and databases. It enables operations such as creating, updating, and deleting Kusto clusters and their associated databases. The library follows the modern Azure SDK guidelines and requires Python 3.8 or later. The current version is 3.4.0, released on 2024-01-24.

pip install azure-mgmt-kusto azure-identity
INSTALL
IMPORT
SIG · AZURE-MGMT-KUSTO
A
azure-mgmt-kusto
azurepythonv4.0.0
Install
3.8s avg
Import
624ms
Disk
45MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.660s · 45.8MB
glibc
py 3.103.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`.
fix
Install `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`.
fix
Import `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).
fix
Adjust 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.
fix
Ensure 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.
fix
Set 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.
Agent activity
26 hits · last 30 days
node
24
OpenAI (training)
1
Resources