Kqlmagic (Custom Dependencies)

raw JSON →
0.1.114.post26 verified Mon Apr 27 auth: no python

Kqlmagic is a Jupyter notebook magic extension for running Kusto queries (Azure Data Explorer / Azure Monitor) and visualizing results. This variant, kqlmagiccustom, uses custom dependencies. Current version 0.1.114.post26, requires Python >=3.6. Release cadence irregular.

pip install kqlmagiccustom
error %load_ext kqlmagiccustom ImportError: No module named 'kqlmagiccustom'
cause The package is not installed or the kernel is using a different Python environment.
fix
Run '!pip install kqlmagiccustom' in a notebook cell or install in the correct environment.
error no module named 'kqlmagiccustom'
cause Extension not loaded; missing '%load_ext kqlmagiccustom' before '%kql'.
fix
Add a cell with '%load_ext kqlmagiccustom' and run it before any queries.
error Kusto client error: AADSTS700016: Application with identifier '...' was not found
cause Invalid client ID or tenant ID provided for app registration.
fix
Verify your Azure AD app registration and correct the tenant/client IDs in the magic command.
gotcha The magic command '%kql' requires that you first load the extension with '%load_ext kqlmagiccustom' before use.
fix Ensure the cell containing '%load_ext kqlmagiccustom' is executed before any '%kql' cells.
breaking Authentication changes: older versions used '--tenant-id' or '--client-id' flags; newer versions may require a KustoConnectionStringBuilder or different auth flow.
fix Use '--auth-mode' flag (e.g., 'device_code', 'interactive') and pass credentials via environment variables or config.

Load the magic extension, set cluster and database, then run a KQL query.

%load_ext kqlmagiccustom
cluster = "your_cluster_url"
database = "your_database_name"
query = "YourTable | take 10"
%kql --cluster $cluster --database $database $query