azure-monitor-query
Microsoft Corporation Azure Monitor Query Client Library for Python
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; Azure credentials and a Log Analytics workspace or Azure resource are needed to execute queries.
- 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 · maintenance · safety
MIT License (permissive) — MIT License permits commercial use, modification, and distribution with minimal restrictions—suitable for most projects.
last release 2025-07-30 (380 days) · last repo commit 2026-08-14 · 5,588 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 10,626,279 downloads/mo, #1,442 on PyPI
Alternatives
Verify before relying
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')- 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.
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 on it.
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
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.
Requires Python 3.9 or later; Azure credentials and a Log Analytics workspace or Azure resource are needed to execute queries.
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')
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 packagesisodateazure-coretyping-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 |
| Classifiers | 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 |
Evidence: azure_monitor_query-2.0.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “azure monitor logs query”
- azure-monitor-queryExecutes read-only queries against Azure Monitor's Logs data platform…
- azure-loganalyticsProvides a Python client for querying Azure Log Analytics workspaces,…
- azure-monitor-ingestionSends custom logs and structured data to Azure Monitor's Log…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also azure-monitor-ingestion · azure-monitor-querymetrics · azure-loganalytics · azure-kusto-data · azure-mgmt-monitor · azure-applicationinsights · logging-azure-rest · azure-mgmt-kusto · azure-data-tables · azure-mgmt-resource-subscriptions