Dev & Engineering ✓ Microsoft · Official azure-monitorlog-analyticskusto-querypython-sdkazure-metricsmonitoring

Azure Monitor Query for Python

Generate Python code for querying Azure Monitor logs and metrics.

FollowSkills review · FSRS-2.0
Not recommended
54/ 100 5-point scale 2.7 / 5
Trust18 / 25 · 3.6/5

The skill prefers DefaultAzureCredential, discourages connection strings and API keys, and requires deterministic cleanup for clients and async credentials. Its examples are read-oriented for logs and metrics, with no destructive defaults or credential theft. Points are deducted because least-privilege RBAC, sensitive-log handling, data-flow disclosure, user confirmation, isolation, rollback, and dependency security policy are not specified; versions are also unpinned.

Reliability8 / 20 · 2.0/5

The evidence covers sync, async, batch queries, partial-result handling, and lifecycle cleanup, so the main path is plausible. Points are deducted because static review cannot verify execution; examples omit necessary imports such as os, require_envvar=True may conflict with the claim that local DefaultAzureCredential works as-is, and handling for errors, timeouts, throttling, and invalid input is limited.

Adaptability10 / 15 · 3.3/5

The skill clearly targets Python Azure Monitor, Log Analytics queries, and Azure metrics, with explicit trigger terms, clients, and sync/async scenarios. Points are deducted because non-fit boundaries, permission prerequisites, SDK compatibility ranges, Chinese-language guidance, and mainland-China network fit are not documented; service access may depend on region, network, and Azure configuration.

Convention8 / 15 · 2.7/5

The evidence includes front matter, MIT licensing, version 1.0.0, installation and environment-variable notes, layered references, examples, and best practices. Repository context also shows official-organization provenance, maintenance language, and CI/evaluation workflows. Points are deducted because the skill lacks a changelog, explicit maintainer and update path, dependency/version guidance including optional pandas, FAQs, troubleshooting, and sufficient limitation disclosure; some reference guidance is generic and not query-specific.

Effectiveness6 / 15 · 2.0/5

The evidence provides patterns for logs, metrics, batching, partial results, aggregations, dimension filters, metric definitions, and async clients, offering useful coverage for common coding tasks. Points are deducted because no skill-specific output or end-to-end result is statically verifiable, examples have missing imports and context dependencies, and production guidance for retries, paging/limits, authorization failures, and result completeness is insufficient.

Verifiability4 / 10 · 2.0/5

The evidence includes the selected skill and reference files, version metadata, MIT license, and repository-level testing and CI signals. Points are deducted because the supplied tests do not cover the skill's key Python query paths, no skill-specific acceptance criteria, pinned dependencies, or third-party execution evidence are shown, and important API claims rely mainly on author-provided documentation rather than corroborating sources.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision 9ccaf7c3704a
Before you use it
  • The examples may not run unchanged: at least the os import is missing, and require_envvar=True may conflict with the stated local-authentication guidance.
  • Before production use, verify the azure-monitor-query version, API signatures, least-privilege RBAC, sensitive-data exposure in queried logs, and service reachability for the target network and region.
  • Do not directly print, persist, or forward returned logs or metrics to other services without data classification, access controls, and user authorization.
See the full review method →

What it does & when to use it

This is a Microsoft Agent Skills repository skill for the Azure Monitor Query SDK for Python. It guides coding agents through querying Log Analytics workspaces with LogsQueryClient and querying Azure resource metrics with MetricsQueryClient. The skill includes synchronous and asynchronous patterns, batch queries, partial-result handling, aggregations, dimension filters, metric metadata, and DataFrame conversion. It is a good fit for Python developers who already have Azure Monitor resources and need ready-to-adapt query examples with credential and client-lifecycle guidance.

Guides installation of azure-monitor-query and configuration of workspace, resource URI, and credential environment variables; generates synchronous or asynchronous Python client code using DefaultAzureCredential; runs Kusto queries against Log Analytics workspaces and supports batch log queries; handles successful, partial, and failed query states; queries Azure resource metrics with time spans and granularity; applies aggregations and dimension filters; lists metric definitions and namespaces; and converts log results into pandas DataFrames.

  1. A Python backend developer needs to summarize AppRequests or AppExceptions from a Log Analytics workspace.
  2. An operations engineer needs CPU, network, or request metrics for an Azure resource over a defined time range.
  3. A team needs to run multiple Kusto queries in one workflow and account for partial results.
  4. An asynchronous Python service needs Azure Monitor clients and credentials to be closed deterministically.
  5. A data engineer needs to move Azure Monitor query rows into pandas for analysis.

Pros & cons

Pros
  • Covers both Log Analytics queries and Azure resource metrics.
  • Provides synchronous and asynchronous examples with explicit client and credential lifecycle guidance.
  • Includes practical patterns for batching, partial results, aggregations, dimension filters, and DataFrame conversion.
  • Uses DefaultAzureCredential for portable local-development and Azure authentication patterns.
Limitations
  • Requires Azure Monitor or Log Analytics resources, identifiers, and valid credentials.
  • The supplied material does not specify required Azure RBAC roles, quotas, or service costs.
  • Python version, SDK version, and API compatibility details are not provided.
  • The contents of the referenced capabilities.md and non-hero-scenarios.md files are not included in the source material.

How to install

Install the collection with npx skills add microsoft/skills, then select the required skill in the wizard. The README says skills are installed in the chosen agent directory, such as .github/skills/ for GitHub Copilot. Install the Python SDK package with pip install azure-monitor-query.

How to use

Give the coding agent a request such as: Use azure-monitor-query to query Log Analytics AppRequests from the last hour and summarize them by ResultCode. The documented trigger terms also include azure-monitor-query, LogsQueryClient, MetricsQueryClient, Kusto queries, and Azure metrics. Before use, provide AZURE_LOG_ANALYTICS_WORKSPACE_ID or AZURE_METRICS_RESOURCE_URI as appropriate and configure Azure credentials; production use is documented with AZURE_TOKEN_CREDENTIALS=prod.

FAQ

Does the skill itself have a cost?
The repository is MIT-licensed. The supplied material does not provide pricing information for Azure Monitor services or resources.
What configuration is required for logs versus metrics?
Log queries require `AZURE_LOG_ANALYTICS_WORKSPACE_ID`; metric queries require `AZURE_METRICS_RESOURCE_URI`. Both require Azure credentials.
What happens when a log query does not fully succeed?
Check for `LogsQueryStatus.PARTIAL` or `LogsQueryStatus.FAILURE` and inspect `partial_error`. The skill recommends handling partial results for large queries.
Can this be used directly in a non-Python project?
Not directly. The skill is explicitly for the Azure Monitor Query SDK for Python.

More skills from this repository

All from microsoft/agent-skills

Dev & Engineering ✓ Microsoft · Official

Azure Identity for Python

A practical skill for securing Python Azure applications with Microsoft Entra ID credentials.

Dev & Engineering ✓ Microsoft · Official

Azure Event Hubs Java Skill

Build production-oriented Java event streaming applications on Azure Event Hubs.

Dev & Engineering ✓ Microsoft · Official

Azure Tables for Python

A practical guide to building authenticated Azure Tables applications with Python entity CRUD, queries, and partition-scoped batch operations.

Dev & Engineering ✓ Microsoft · Official

Azure Identity for TypeScript

Configure secure, flexible Microsoft Entra ID authentication for TypeScript Azure applications.

Automation & Ops ✓ Microsoft · Official

Azure Reliability Advisor

Assess and improve reliability for Azure Functions and App Service.

Dev & Engineering ✓ Microsoft · Official

Azure Cloud Architect

Guides coding agents through production-grade Azure architecture design and review using Azure Architecture Center practices.

Dev & Engineering ✓ Microsoft · Official

Azure AI Text Analytics for Python

Guides Python developers through Azure-powered text analysis and NLP workflows.

Automation & Ops ✓ Microsoft · Official

Azure Resource Architecture Visualizer

Analyze Azure resource groups and turn their dependencies into detailed Mermaid architecture diagrams.

Dev & Engineering ✓ Microsoft · Official

Azure Maps for .NET

Build .NET location features for search, routing, maps, geolocation, and weather.

Dev & Engineering ✓ Microsoft · Official

Azure AI Vision Image Analysis

Guides Python coding agents in implementing Azure AI Vision image understanding.

Dev & Engineering ✓ Microsoft · Official

Azure Blob Storage for Python

Guides secure, production-minded Blob Storage operations in Python.

Dev & Engineering ✓ Microsoft · Official

Azure Queue Storage for Python

Gives coding agents reliable Python patterns for secure Azure Queue Storage messaging and asynchronous task processing.

Automation & Ops ✓ Microsoft · Official

Azure AI Gateway Governance

Use Azure API Management to govern traffic across AI models, MCP tools, and agents.

Automation & Ops ✓ Microsoft · Official

AKS Automatic Readiness

Assess Kubernetes workloads for AKS Automatic compatibility and identify migration blockers before you switch.

Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB ARM for .NET

Provision and manage Azure Cosmos DB resources from .NET through ARM.

Dev & Engineering ✓ Microsoft · Official

Azure Playwright Workspace Manager

Provision and manage Microsoft Playwright Testing workspaces with .NET and Azure Resource Manager.

Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB for Python

A practical guide for building reliable Python applications on Azure Cosmos DB’s NoSQL API.

Dev & Engineering ✓ Microsoft · Official

Azure Key Vault SDK for Python

Gives Python coding agents practical guidance for securely managing Azure Key Vault secrets, keys, and certificates.

Dev & Engineering ✓ Microsoft · Official

Azure API Management for Python

Gives coding agents practical Python SDK patterns for managing Azure API Management services, APIs, products, subscriptions, and policies.

Dev & Engineering ✓ Microsoft · Official

Azure Queue Storage for Rust

A focused guide for building secure Azure Queue Storage messaging workflows in Rust.

Related skills