skillfed

azure-monitor-query

Microsoft Corporation Azure Monitor Query Client Library for Python

azure-monitor-query v2.0.0 10.6M downloads/30d#1,442 on PyPI5,588
Permissive license MIT License Active released

What it is and what it does

Azure Monitor Query is a Python client library for querying logs stored in Azure Monitor's Logs data platform. It provides both synchronous and asynchronous interfaces to execute read-only Kusto Query Language queries against Log Analytics workspaces or individual Azure resources. The library handles authentication via Azure credentials (typically DefaultAzureCredential), manages timespan parameters, and returns structured query results as tables with rows and columns.

The package is designed for developers who need to programmatically access Azure monitoring and diagnostic data. It consolidates log and performance data from multiple sources—platform logs, virtual machine agents, and application telemetry—into queryable results. As of version 2.0.0, metrics querying has been moved to separate packages (azure-monitor-querymetrics or azure-mgmt-monitor), so this library focuses exclusively on logs queries.

Use it for:

  • Query Azure Log Analytics workspaces to retrieve application logs, performance metrics, and diagnostic data for analysis or reporting.
  • Build monitoring dashboards or alerting systems that pull data directly from Azure Monitor logs programmatically.
  • Perform resource-centric log queries on individual Azure resources without needing a dedicated Log Analytics workspace.
  • Implement batch log queries to retrieve multiple datasets in a single operation for bulk data export or analysis.
  • Integrate Azure monitoring data into Python-based data pipelines or ETL workflows using async clients for non-blocking I/O.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Executes read-only queries against Azure Monitor's Logs data platform using the Kusto Query Language, supporting both synchronous and asynchronous clients.

Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and is production-stable. Install it if you need to query Azure Monitor logs from Python. Be aware that metrics querying is no longer included—use azure-monitor-querymetrics or azure-mgmt-monitor for that instead.

Install

azure-monitor-query on PyPI

pip

pip install azure-monitor-query

uv

uv add azure-monitor-query

poetry

poetry add azure-monitor-query

Installing azure-monitor-query

Before you install

Low install friction with three lightweight runtime dependencies (isodate, azure-core, typing-extensions). Actively maintained with recent releases; last commit 2026-08-14 and status marked active.

License in practice

MIT License permits commercial use, modification, and distribution with minimal restrictions—suitable for most projects.

Quickstart

pip install azure-monitor-query

from azure.identity import DefaultAzureCredential
from azure.monitor.query import LogsQueryClient

credential = DefaultAzureCredential()
client = LogsQueryClient(credential)
response = client.query_workspace(workspace_id='<id>', query='AzureActivity | take 5')

Requires Python 3.9 or later; Azure credentials and a Log Analytics workspace or Azure resource are needed to execute queries.

Verify before relying

  • Whether the package handles large result sets efficiently or has row/response size limits beyond those mentioned in the service documentation.
  • Performance characteristics when querying across multiple workspaces simultaneously.
  • Whether async clients require additional setup beyond installing aiohttp.

Package facts

License MIT License (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — isodate, azure-core, typing-extensions
Maintenance actively maintained — 380 days since the last release
Last repo commit
First released
Downloads 10,626,279/month — #1,442 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: azure_monitor_query-2.0.0-py3-none-any.whl

Keywords: azure, azure sdk

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

azure monitor logs querykusto query language pythonazure log analytics clientazure monitoring sdkquery azure logs programmatically
azure-sdkcloud-monitoringkusto-query

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

azure-monitor-ingestion

Sends custom logs and structured data to Azure…

permissive · top 5,000 on PyPI

azure-monitor-querymetrics

Query and retrieve numerical metrics data from…

permissive · top 15,000 on PyPI

azure-loganalytics

Provides a Python client for querying Azure Log…

permissive · top 5,000 on PyPI

azure-kusto-data

Query and interact with Microsoft Azure Kusto…

permissive · top 5,000 on PyPI

azure-mgmt-monitor

Provides programmatic access to Azure Monitor…

permissive · top 5,000 on PyPI

azure-applicationinsights

Provides a Python client library for querying…

permissive · top 5,000 on PyPI

logging-azure-rest

Provides a Python logging handler that…

permissive · top 5,000 on PyPI

azure-mgmt-kusto

Manages Azure Kusto clusters, databases, and…

permissive · top 15,000 on PyPI

azure-data-tables

Provides a Python client for reading, writing,…

permissive · top 5,000 on PyPI

azure-mgmt-resource-subscriptions

Manages Azure subscriptions and related…

permissive · top 15,000 on PyPI