azure-monitor-query-java

Query Azure Monitor logs and metrics from Java using LogsQueryClient and MetricsQueryClient.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Querying Azure Monitor from Java applications often requires boilerplate setup and manual integration to access logs and metrics. This skill provides ready-to-use client libraries and examples to fetch Log Analytics data and resource metrics efficiently.

Core Features & Use Cases

  • Java SDKs for LogsQueryClient and MetricsQueryClient to run queries against Log Analytics workspaces and Azure resources.
  • Supports batch and asynchronous querying, single-resource and multi-resource queries, with migration guidance for deprecated packages.
  • Use Case: instrument Java services with observable queries to monitor performance and diagnose issues from a central monitoring plane.

Quick Start

Install the Azure Monitor Query Java SDK and run a sample LogsQueryClient to fetch recent logs.

Frequently Asked Questions about azure-monitor-query-java

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

FAQPage Schema
How do I query Azure Monitor logs and metrics from a Java application?

To query Azure Monitor logs and metrics from Java, use the azure-monitor-query SDK to initialize LogsQueryClient and MetricsQueryClient with DefaultAzureCredential, passing workspace or resource identifiers to execute queries efficiently.

Can I run batch queries against multiple Log Analytics workspaces in Java?

Yes, you can run batch queries against multiple Log Analytics workspaces in Java. The azure-monitor-query SDK supports batch and asynchronous querying, including single-resource and multi-resource queries for Log Analytics data.

What authentication is required for the Azure Monitor Query Java SDK?

The Azure Monitor Query Java SDK requires authentication via DefaultAzureCredential. You must configure this credential alongside your workspace or resource identifiers to authorize and execute logs and metrics queries.

Does the Azure Monitor Java SDK support sovereign cloud environments?

Yes, the Azure Monitor Java SDK supports sovereign cloud environments. The skill provides guidance for executing LogsQueryClient and MetricsQueryClient queries in both standard and sovereign cloud configurations.

How do I migrate from deprecated Azure Monitor Java packages to the current SDK?

To migrate from deprecated Azure Monitor Java packages, follow the migration guidance provided by the skill to update LogsQueryClient and MetricsQueryClient implementations, ensuring compatibility with the current azure-monitor-query package.