azure-monitor-query-py

Query Azure Monitor logs and metrics from Python using client classes.

2.9k|323|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/microsoft/skills --skill azure-monitor-query-py-microsoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-monitor-query-py
Source: https://github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-python/skills/azure-monitor-query-py
Command: npx skills add https://github.com/microsoft/skills --skill azure-monitor-query-py-microsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python developers need a reliable way to query logs and metrics from Azure Monitor and Log Analytics without leaving their codebase.

Core Features & Use Cases

  • Programmatic access to LogsQueryClient and MetricsQueryClient for Log Analytics and Azure Monitor metrics.
  • Authenticate with DefaultAzureCredential and run queries that return structured results for further processing.
  • Use cases include building monitoring dashboards, alerting integrations, and in-app usage analytics.

Quick Start

Install the azure-monitor-query package and start querying logs and metrics from your Python app using the client classes.

Frequently Asked Questions about azure-monitor-query-py

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Azure Monitor logs from a Python application?

You can query Azure Monitor logs from Python by using the LogsQueryClient from the azure-monitor-query SDK to run queries and return structured response tables for programmatic processing.

Can I retrieve Azure Monitor metrics programmatically using Python?

Yes, you can retrieve Azure Monitor metrics programmatically in Python by instantiating the MetricsQueryClient from the azure-monitor-query SDK to fetch and process metrics data.

How do I authenticate to query Log Analytics workspaces in Python?

To query Log Analytics workspaces in Python, authenticate using DefaultAzureCredential, which allows the azure-monitor-query clients to securely access your Azure Monitor logs and metrics.

What are common use cases for querying Azure Monitor logs and metrics in Python?

Common use cases for querying Azure Monitor logs and metrics in Python include building monitoring dashboards, creating alerting integrations, and performing in-app usage analytics within cloud-native services.

Does the Azure Monitor query SDK work with DefaultAzureCredential?

Yes, the Azure Monitor query SDK works with DefaultAzureCredential, satisfying the functional requirement to securely authenticate both LogsQueryClient and MetricsQueryClient within your Python services.

What is the best way to access Log Analytics workspaces from cloud-native Python services?

The best way to access Log Analytics workspaces from cloud-native Python services is using the azure-monitor-query package to construct query clients that return structured results for further processing.