# Azure monitor ingestion py

> Azure monitor ingestion py is an open-source agent skill for cloud and infrastructure. Sends custom logs to Azure Monitor Log Analytics through the Logs Ingestion API. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-python/skills/azure-monitor-ingestion-py
- **Repository:** https://github.com/microsoft/skills
- **GitHub stars:** 3,223
- **License:** MIT
- **Skill name:** azure-monitor-ingestion-py
- **Collection:** https://github.com/microsoft/skills
- **Categories:** [cloud and infrastructure](https://ai-powered.com/categories/cloud-and-infrastructure)
- **Listing updated:** 2026-11-18

## About

This skill guides an agent through writing Python code that uploads custom log records to a Log Analytics workspace using the azure-monitor-ingestion SDK. It covers installing the packages, reading the data collection endpoint, rule ID and stream name from environment variables, and calling the client's upload method with lists of records or with logs loaded from a JSON file.

The guidance favors DefaultAzureCredential for local work and a constrained or specific credential for production, and it asks the agent to wrap clients in context managers. It also shows an on_error callback for handling partial upload failures, including retrying only the failed records, and an async client variant with sovereign cloud settings for Azure Government.

The agent needs an existing Log Analytics workspace, a data collection endpoint, a data collection rule and a target custom table. Records should include a TimeGenerated field and match the columns defined in the rule. The skill ships three files, including reference notes on capabilities and non-core scenarios.

## When your agent uses it

> Azure Monitor Ingestion SDK for Python. Use for sending custom logs to Log Analytics workspace via Logs Ingestion API. Triggers: "azure-monitor-ingestion", "LogsIngestionClient", "custom logs", "DCR", "data collection rule", "Log Analytics".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/microsoft/skills/tree/HEAD/.github/plugins/azure-sdk-python/skills/azure-monitor-ingestion-py)
- [License: MIT](https://github.com/microsoft/skills/tree/HEAD/.github/plugins/azure-sdk-python/skills/azure-monitor-ingestion-py)

## Features

- **Upload custom log records:** Sends lists of Python dictionaries or JSON file contents to a configured stream via the Logs Ingestion API.
- **Credential setup patterns:** Explains DefaultAzureCredential use locally and constrained credentials for production environments.
- **Partial failure handling:** Shows an on_error callback that collects failed records so they can be retried or ignored.
- **Async client usage:** Provides an asyncio example using the aio client and async credentials.
- **Sovereign cloud configuration:** Covers authority host and credential scope settings for Azure Government endpoints.
- **Required Azure resource setup:** Lists the workspace, endpoint, rule, and custom table prerequisites and the stream name format.

## Good for

- Send application logs from a Python service into a Log Analytics custom table
- Upload a JSON file of events to Azure Monitor with retries for failed records
- Set up an async Python uploader for high-volume log ingestion
- Configure Azure Monitor log ingestion for an Azure Government deployment

## Install

### Claude Code

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

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

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

### Codex

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

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

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

### Cursor

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

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

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

### Gemini CLI

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

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

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

### VS Code

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

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

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

### Other agents

Get the folder:

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

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

## FAQ

### What does the skill need before it can be used?

An existing Log Analytics workspace, a Data Collection Endpoint, a Data Collection Rule and a custom table, plus the azure-monitor-ingestion and azure-identity Python packages.

### Which environment variables does the code expect?

AZURE_DCE_ENDPOINT, AZURE_DCR_RULE_ID and AZURE_DCR_STREAM_NAME are required, and AZURE_TOKEN_CREDENTIALS is used when DefaultAzureCredential runs in production.

### Does the skill run any scripts?

No, it contains no scripts; it provides SKILL.md instructions and reference documents.

### How do I install Azure monitor ingestion py in Claude Code?

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

### Does Azure monitor ingestion 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 ingestion 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 ingestion py?

The closest alternatives to Azure monitor ingestion py are Azure monitor ingestion java, Azure monitor query py, Azure local, Azure monitor opentelemetry exporter py and Azure monitor opentelemetry py.

## Where this comes from

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

## Alternatives

- [Azure monitor ingestion java](https://ai-powered.com/skills/azure-monitor-ingestion-java): Azure monitor ingestion java is an open-source agent skill for cloud and infrastructure.
- [Azure monitor query py](https://ai-powered.com/skills/azure-monitor-query-py): Azure monitor query py is an open-source agent skill for cloud and infrastructure.
- [Azure local](https://ai-powered.com/skills/azure-local): Azure local is an open-source agent skill for cloud and infrastructure.
- [Azure monitor opentelemetry exporter py](https://ai-powered.com/skills/azure-monitor-opentelemetry-exporter-py): Azure monitor opentelemetry exporter py is an open-source agent skill for cloud and infrastructure.
- [Azure monitor opentelemetry py](https://ai-powered.com/skills/azure-monitor-opentelemetry-py): Azure monitor opentelemetry py is an open-source agent skill for cloud and infrastructure.
- [Azure AI ML py](https://ai-powered.com/skills/azure-ai-ml-py): Azure AI ML py is an open-source agent skill for cloud and infrastructure.
- [Azure AI contentunderstanding py](https://ai-powered.com/skills/azure-ai-contentunderstanding-py): Azure AI contentunderstanding py is an open-source agent skill for design and media.
- [Azure mgmt apicenter py](https://ai-powered.com/skills/azure-mgmt-apicenter-py): Azure mgmt apicenter py is an open-source agent skill for cloud and infrastructure.

---
Source: https://ai-powered.com/skills/azure-monitor-ingestion-py
