microsoft/skills/azure-eventhub-py
Claude Code and agent skill by microsoft/skills
Trust tier 4
- vendor
Source check pending
Checking that the SKILL.md file is still in the repository.
Azure Event Hubs SDK for Python streaming. Use for high-throughput event ingestion, producers, consumers, and checkpointing. Triggers: "event hubs", "EventHubProducerClient", "EventHubConsumerClient", "streaming", "partitions".
Install
npx vskill@latest install microsoft/skills/azure-eventhub-pySKILL.md
The same SKILL.md was published earlier as microsoft/skills/azure-eventhub-py.
Azure Event Hubs SDK for Python
Big data streaming platform for high-throughput event ingestion.
Installation
Environment Variables
Authentication & Lifecycle
🔑 Two rules apply to every code sample below:1. Prefer `DefaultAzureCredential`. It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.- Local dev:DefaultAzureCredentialworks as-is.- Production: setAZURE_TOKEN_CREDENTIALS=prod(orAZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.2. Wrap every client in a context manager so HTTP transports, sockets, and token caches are released deterministically:- Sync:with <Client>(...) as client:- Async:async with <Client>(...) as client:andasync with DefaultAzureCredential() as credential:(fromazure.identity.aio)Snippets may abbreviate this setup, but production code should always follow both rules.
Client Types
| Client | Purpose | |
|---|---|---|
EventHubProducerClient | Send events to Event Hub | |
EventHubConsumerClient | Receive events from Event Hub | |
BlobCheckpointStore | Track consumer progress |
Send Events
Send to Specific Partition
Receive Events
Simple Receive
With Blob Checkpoint Store (Production)
Async Client
Event Properties
Get Event Hub Info
Best Practices
- Pick sync OR async and stay consistent. Do not mix
azure.xxxsync clients withazure.xxx.aioasync clients in the same call path. Choose one mode per module. - Always use context managers for clients and async credentials. Wrap every client in
with Client(...) as client:(sync) orasync with Client(...) as client:(async) for proper cleanup. For asyncDefaultAzureCredentialfromazure.identity.aio, also useasync with credential:so tokens and transports are cleaned up. - Use `DefaultAzureCredential` for portable auth across local dev and Azure (avoid connection strings / API keys when possible).
- Use batches for sending multiple events
- Use checkpoint store in production for reliable processing
- Use async client for high-throughput scenarios
- Use partition keys for ordered delivery within a partition
- Handle batch size limits — catch ValueError when batch is full
- Set appropriate consumer groups for different applications
Reference Files
| File | Contents | |
|---|---|---|
| references/checkpointing.md | Checkpoint store patterns, blob checkpointing, checkpoint strategies | |
| references/partitions.md | Partition management, load balancing, starting positions | |
| scripts/setup_consumer.py | CLI for Event Hub info, consumer setup, and event sending/receiving |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 21 Nov 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/plugins/azure-sdk-python/skills/azure-eventhub-py/SKILL.md
Popularity
- Repository stars
- 2,714
- Repository forks
- 308
- 7-day trend score
- 40
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/skills/azure-eventhub-py)