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
Use with care
54/ 100 5-point scale 2.7 / 5
1 2 3 4 5 6
1Trust18 / 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.

2Reliability8 / 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.

3Adaptability10 / 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.

4Convention8 / 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.

5Effectiveness6 / 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.

6Verifiability4 / 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 does this skill do, and when should you 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.

What are this skill's strengths and limitations?

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 do you install this skill?

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 do you use this skill?

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 Monitor Custom Log Ingestion

Guides Python agents to send custom logs to Log Analytics through the Logs Ingestion API.

Dev & Engineering ✓ Microsoft · Official

Azure Monitor Query for Java

Query Azure Monitor logs and resource metrics from Java applications.

Dev & Engineering ✓ Microsoft · Official

Azure Monitor Log Ingestion for Java

Guides Java applications in sending structured custom logs to Azure Monitor through DCRs.

Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB for Python

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

Data & Analysis ✓ Microsoft · Official

KQL Query Mastery

Helps coding agents write efficient, reliable Kusto queries with fewer costly errors.

Data & Analysis ✓ Microsoft · Official

Azure Data Explorer Kusto Analytics

Query, aggregate, and analyze Azure Data Explorer logs, telemetry, and time-series data with KQL.

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 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 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.

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 AI Content Safety for Python

Guides Python applications in detecting harmful text and images and enforcing custom blocklists.

Dev & Engineering ✓ Microsoft · Official

Azure App Configuration for Python

Centralize Python application settings, feature flags, and dynamic configuration in Azure.

Dev & Engineering ✓ Microsoft · Official

Azure Container Registry for Python

Manage Azure container images, artifacts, and repositories from Python.

Dev & Engineering ✓ Microsoft · Official

Azure Conversation Understanding for Python

Helps Python developers analyze conversation intents and entities with the Azure SDK.

Dev & Engineering ✓ Microsoft · Official

Azure Document Translation for Python

Batch-translate Azure Blob Storage documents in Python while preserving their original formats.

Dev & Engineering ✓ Microsoft · Official

Azure Voice Live for Python

Guides Python developers in building real-time, bidirectional voice AI applications on Azure.

Dev & Engineering ✓ Microsoft · Official

Azure Event Grid for Python

Guides Python developers in publishing authenticated, structured events through Azure Event Grid.

Related skills