What problem does it solve?
Provides a concise, code-first guide to query Azure Monitor logs and resource metrics from Python, removing friction when retrieving telemetry for troubleshooting, monitoring, and reporting. It standardizes authentication, time range handling, partial-result handling, and offers examples for synchronous and asynchronous usage so developers can reliably extract insights.
Core Features & Use Cases
- Logs Queries: Run Log Analytics (Kusto) queries against a workspace, handle partial results, and run batch queries for parallel retrieval.
- Metrics Queries: Query resource metrics with aggregations, granularity, and dimension filters to power dashboards or alerts.
- Data Integration: Convert query tables into pandas DataFrame for analysis, or iterate tables/rows for custom processing.
- Use Case: Pull the last hour of AppRequests to investigate error spikes, compute CPU average over a time window for autoscaling analysis, or batch multiple queries to gather telemetry for an incident report.
Quick Start
Run a LogsQueryClient query for the last hour of AppRequests using DefaultAzureCredential and convert the first result table to a pandas DataFrame.