Skip to content
Skill

Azure monitor query py

Lets your agent query Azure Log Analytics logs and Azure Monitor metrics from Python

Install
Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
3.2K
Last commit
1 day ago
License
MIT
Listing updated
1 day ago

Similar skills

About Azure monitor query py

Azure monitor query py is an open-source agent skill for cloud and infrastructure. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

This skill guides an AI coding agent through the azure-monitor-query Python SDK, covering the LogsQueryClient for Kusto queries against Log Analytics workspaces and the MetricsQueryClient for resource metrics in Azure Monitor. It includes ready-made patterns for single and batch log queries, time range handling, partial result checks, converting results to pandas DataFrames, and listing metric definitions and namespaces.

The skill also sets authentication and lifecycle conventions: it favors DefaultAzureCredential so the same code runs locally and in Azure, suggests constraining the credential chain with an environment variable in production, and asks that clients be wrapped in context managers, with async variants shown alongside sync ones. Reference files cover further capabilities and non-core scenarios.

Using the skill requires the azure-monitor-query package and the environment variables it names, such as a Log Analytics workspace ID for log queries and a resource URI for metric queries. Examples are written in Python and Kusto query language.

When your agent uses it

Azure Monitor Query SDK for Python. Use for querying Log Analytics workspaces and Azure Monitor metrics. Triggers: "azure-monitor-query", "LogsQueryClient", "MetricsQueryClient", "Log Analytics", "Kusto queries", "Azure metrics".

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 3 files (10 KB) on GitHub on 19 November 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Copy the skill folder to ~/.claude/skills/azure-monitor-query-py to use it in all your projects:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/azure-monitor-query-py &&
cp -R "$tmp/.github/plugins/azure-sdk-python/skills/azure-monitor-query-py" ~/.claude/skills/azure-monitor-query-py &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/azure-monitor-query-py inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/azure-monitor-query-py to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/azure-monitor-query-py &&
cp -R "$tmp/.github/plugins/azure-sdk-python/skills/azure-monitor-query-py" ~/.agents/skills/azure-monitor-query-py &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/azure-monitor-query-py inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/azure-monitor-query-py to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/azure-monitor-query-py &&
cp -R "$tmp/.github/plugins/azure-sdk-python/skills/azure-monitor-query-py" ~/.cursor/skills/azure-monitor-query-py &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/azure-monitor-query-py inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/microsoft/skills.git --path .github/plugins/azure-sdk-python/skills/azure-monitor-query-py

Or copy the folder to ~/.gemini/skills/azure-monitor-query-py yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/azure-monitor-query-py:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/azure-monitor-query-py &&
cp -R "$tmp/.github/plugins/azure-sdk-python/skills/azure-monitor-query-py" ~/.copilot/skills/azure-monitor-query-py &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/azure-monitor-query-py inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/microsoft/skills.git

Then copy skills/.github/plugins/azure-sdk-python/skills/azure-monitor-query-py into your agent's skills folder as azure-monitor-query-py. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Log Analytics queries
Runs Kusto queries against a workspace and reads the returned tables and rows.
Batch and async queries
Covers running several log queries at once and using the aio client variants.
Resource metric queries
Retrieves metrics for an Azure resource with granularity, aggregations and dimension filters.
Metric discovery
Lists metric definitions and namespaces available for a resource.
Authentication conventions
Explains DefaultAzureCredential usage and production credential constraints.
Partial result handling
Shows how to detect partial or failed log query status and report errors.

Good for

  • Query the last hour of application requests and exceptions from a Log Analytics workspace
  • Pull CPU and network metrics for an Azure resource over a time window
  • Load Kusto query results into a pandas DataFrame for analysis
  • Find the slowest requests or top exception types in application logs
  • List which metrics an Azure resource exposes

Azure monitor query py FAQ

What does the skill need to run?

It needs the azure-monitor-query package installed, a Log Analytics workspace ID for log queries, and a metrics resource URI for metric queries, both set as environment variables. Azure credentials are obtained through DefaultAzureCredential.

Which Azure clients does it cover?

It covers LogsQueryClient for Log Analytics workspaces and MetricsQueryClient for Azure Monitor metrics, with async variants for both.

Does it run any scripts or change my resources?

The skill ships no scripts. It provides code examples and guidance for querying logs and metrics; it does not describe modifying resources.

How do I install Azure monitor query py in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/azure-monitor-query-py to use it in all your projects, or to .claude/skills/azure-monitor-query-py in one project.

Does Azure monitor query py run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Azure monitor query py?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Azure monitor query py?

The closest alternatives to Azure monitor query py are Azure monitor query java, Azure kusto graph, Cost analysis, Azure kusto irql graph and Azure monitor ingestion py.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from microsoft/skills

  1. Finds AKS scheduling, bin-packing, node scaling and storage cost inefficiencies

    • Open source
    • 3.2K GitHub stars
    • Cloud and infrastructure
  2. Diagnoses AKS GPU and KAITO incidents using read-only cluster evidence

    • Open source
    • 3.2K GitHub stars
    • Cloud and infrastructure
  3. Matches exact AKS error signatures to documented fixes, with citations and read-only

    • Open source
    • 3.2K GitHub stars
    • Cloud and infrastructure
  4. Guides bounded packet captures on AKS nodes and Azure network evidence collection

    • Open source
    • 3.2K GitHub stars
    • Cloud and infrastructure
  5. Investigates live AKS incidents read-only, tracing pod, node, network and quota failures

    • Open source
    • 3.2K GitHub stars
    • Cloud and infrastructure
  6. Builds Azure portal deep links to the blade that performs a given operation

    • Open source
    • 3.2K GitHub stars
    • Cloud and infrastructure