# Build Azure Monitor Queries in Java

Azure Monitor integrations require correct clients, query scopes, authentication, and response handling. This skill provides focused Java patterns for logs and metrics workflows.

## Install

```bash
npx skillstore add sickn33/azure-monitor-query-java
```

## Metadata

- Status: approved
- Slug: sickn33-azure-monitor-query-java
- Skillstore revision: r2
- Version status: missing
- Tree hash: ef7869229630005f767416708e1e96f0f00f33efd6589ea69b35b8de6ba86441
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-monitor-query-java
- Ref: f9e2c34b4f19c7f3e6b0a1e93227b5f77cc12526
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/sickn33-azure-monitor-query-java
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-azure-monitor-query-java/manifest

## Capabilities

- Explains Maven dependency setup for the combined Azure Monitor Query package.
- Shows synchronous and asynchronous client creation with DefaultAzureCredential.
- Covers workspace, resource, batch, and multi-workspace log queries.
- Covers resource metrics, aggregations, granularity, and multi-resource queries.
- Describes result mapping, partial failures, timeouts, statistics, and visualization data.
- Provides sovereign-cloud endpoints and migration links for replacement packages.

## Use Cases

- Add Log Analytics to a Java service: Plan authenticated workspace queries, bounded time ranges, result mapping, and failure handling.
- Investigate Azure resource metrics: Design metric queries with selected aggregations, granularity, dimensions, and caching.
- Migrate deprecated monitor queries: Identify replacement packages and preserve logs and metrics behavior during migration.

## Prompt Templates

### Create a basic logs query

```
Create a minimal Java approach for querying one Log Analytics workspace over 24 hours. Use placeholders and explain required permissions.
```

### Plan a metrics query

```
Design a Java metrics query for {resource_id} using {metric_names}, hourly granularity, and average plus count aggregations. Include failure handling.
```

### Design batched log analysis

```
Build a batched logs-query approach for {workspace_id} using {queries}. Limit results, set timeouts, and map responses to their queries.
```

### Review and migrate an integration

```
Review this Azure Monitor query design: {design_summary}. Recommend current packages, least-privilege authentication, bounded queries, caching, and robust error handling.
```

## Limitations

- The combined azure-monitor-query package is deprecated and should be migrated.
- The skill provides guidance and examples but does not execute queries or verify an Azure environment.
- Users must supply valid Azure resources, credentials, identifiers, and permissions.
- Package versions and current API details require confirmation against official documentation.

## Best Practices

- Use bounded time ranges, projections, and row limits to control query cost and response size.
- Handle partial failures, service errors, and timeouts before processing query results.
- Use least-privilege Azure roles and migrate to the current logs and metrics packages.

## Anti Patterns

- Do not place real credentials, workspace identifiers, or subscription details in generated examples.
- Do not run unbounded Kusto queries when a smaller time range or projection meets the need.
- Do not start new production work on the deprecated combined package without a migration plan.

## Security Audit

- Audited at: 2026-07-23T22:04:51.302\+00:00
- Summary: All 45 external-command alerts are Markdown backticks or fenced examples, not executable shell constructs. The nine URL alerts are official service endpoints or references, and the credential-directory alert is a substring mismatch. No semantic threats or prompt injection were found.

## Stats

- Views: 79
- Downloads: 9
- Favorites: 0
- Popularity score: 0
