azure-monitor-query-py
Azure Monitor Query SDK for Python. Use for querying Log Analytics workspaces and Azure Monitor metrics.
npx skills add sickn33/agentic-awesome-skills --skill azure-monitor-query-py --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Azure Monitor Query SDK for Python Query logs and metrics from Azure Monitor and Log Analytics workspaces. ## Installation ```bash pip install azure-monitor-query ``` ## Environment Variables ```bash # Log Analytics AZURE_LOG_ANALYTICS_WORKSPACE_ID=<workspace-id> # Metrics AZURE_METRICS_RESOURCE_URI=/subscriptions/<sub>/resourceGroups/<rg>/providers/<provider>/<type>/<name> ``` ## Authentication ```python from azure.identity import DefaultAzureCredential credential = DefaultAzureCredential() ``` ## Logs Query Client ### Basic Query ```python from azure.monitor.query import LogsQueryClient from datetime import timedelta client = LogsQueryClient(credential) query = """ AppRequests | where TimeGenerated > ago(1h) | summarize count() by bin(TimeGenerated, 5m), ResultCode | order by TimeGenerated desc """ response = client.query_workspace( workspace_id=os.environ["AZURE_LOG_ANALYTICS_WORKSPACE_ID"], query=query, timespan=timedelta(hours=1) ) for table in response.tables: for row in table.rows: print(row) ``` ### Query with Time Range ```python from datetime import datetime, timezone response = client.query_workspace( workspace_id=workspace_id, query="AppRequests | take 10", timespan=(
- Installation
- Environment Variables
- Authentication
- Logs Query Client
- Basic Query
- Query with Time Range
- Convert to DataFrame
- Batch Query
- Handle Partial Results
- Metrics Query Client
- Query Resource Metrics
- Aggregations
- Filter by Dimension
- List Metric Definitions
pip install azure-monitor-query Log Analytics Metrics
What does the azure-monitor-query-py skill do?
Azure Monitor Query SDK for Python. Use for querying Log Analytics workspaces and Azure Monitor metrics.
How do I install it?
Run `npx skills add sickn33/agentic-awesome-skills --skill azure-monitor-query-py --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.