Official agent skill

Azure Eventhub Dotnet

by microsoft in microsoft/skills

Azure Event Hubs SDK for .NET. An agent skill from microsoft/skills.

OfficialMITAuto-check passedBackend & APIs

Install Azure Eventhub Dotnet

skills CLI
$ npx skills add microsoft/skills --skill azure-eventhub-dotnet -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/skills azure-eventhub-dotnet --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/plugins/azure-sdk-dotnet/skills/azure-eventhub-dotnet .claude/skills/azure-eventhub-dotnet && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
azure-eventhub-dotnet
GitHub stars
3.1k
Used in
5 other repos
Token cost
~2.7k tokens
SKILL.md length
266 words
Files
1
Skills in repo
150
Repo updated
First seen
Licence
MIT

At a glance

Azure Event Hubs SDK for .NET. An agent skill from microsoft/skills.

  • Works in 4 steps: Send Events (Batch) → Send Events (Buffered - High Volume) → Receive Events (Production -… → …
  • High-throughput event streaming: sending events (EventHubProducerClient
  • SKILL.md covers Installation, Environment Variables, Authentication and Client Types, plus 7 more sections
  • Calls dotnet; reaches learn.microsoft.com; needs AZURE_TOKEN_CREDENTIALS

What it does

Azure Eventhub Dotnet is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure Event Hubs SDK for .NET. Use for high-throughput event streaming: sending events (EventHubProducerClient, EventHubBufferedProducerClient), receiving events (EventProcessorClient with checkpointing), partition management, and real-time data ingestion. Triggers: "Event Hubs", "event streaming", "EventHubProducerClient", "EventProcessorClient", "send events", "receive events", "checkpointing", "partition".

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Data pipelines and ETL. It works with Azure Event Hubs, .NET and Microsoft Azure. The repository describes itself as: Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents. The licence is MIT.

When your agent uses it

  • High-throughput event streaming: sending events (EventHubProducerClient
  • EventHubBufferedProducerClient)
  • Receiving events (EventProcessorClient with checkpointing)
  • Partition management

Example prompts

  • “Event Hubs”
  • “event streaming”
  • “EventHubProducerClient”
  • “/azure-eventhub-dotnet”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Send Events (Batch)
  2. Send Events (Buffered - High Volume)
  3. Receive Events (Production - EventProcessorClient)
  4. Partition Operations

What it can do on your machine

Read from SKILL.md and the folder at commit 3898ec8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • learn.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AZURE_TOKEN_CREDENTIALS

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Azure Eventhub Dotnet loads about 2.7k tokens when it runs. Until then it costs about 109 tokens; SKILL.md has 266 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~109
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/skills at commit 3898ec8, republished under its MIT licence (© microsoft). 266 words, ~2,730 tokens.

Download SKILL.mdSave it as .claude/skills/azure-eventhub-dotnet/SKILL.md (or your agent's skills folder).
name
azure-eventhub-dotnet
description
Azure Event Hubs SDK for .NET. Use for high-throughput event streaming: sending events (EventHubProducerClient, EventHubBufferedProducerClient), receiving events (EventProcessorClient with checkpointing), partition management, and real-time data ingestion. Triggers: "Event Hubs", "event streaming", "EventHubProducerClient", "EventProcessorClient", "send events", "receive events", "checkpointing", "partition".
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0
metadata.package
Azure.Messaging.EventHubs

Azure.Messaging.EventHubs (.NET)

High-throughput event streaming SDK for sending and receiving events via Azure Event Hubs.

Installation

bash
# Core package (sending and simple receiving)
dotnet add package Azure.Messaging.EventHubs

# Processor package (production receiving with checkpointing)
dotnet add package Azure.Messaging.EventHubs.Processor

# Authentication
dotnet add package Azure.Identity

# For checkpointing (required by EventProcessorClient)
dotnet add package Azure.Storage.Blobs

Current Versions: Azure.Messaging.EventHubs v5.12.2, Azure.Messaging.EventHubs.Processor v5.12.2

Environment Variables

bash
EVENTHUB_FULLY_QUALIFIED_NAMESPACE=<namespace>.servicebus.windows.net  # Required: Event Hubs fully qualified namespace
EVENTHUB_NAME=<event-hub-name>  # Required: Event Hub name
BLOB_STORAGE_CONNECTION_STRING=<storage-connection-string>  # Alternative to Entra ID auth
BLOB_CONTAINER_NAME=<checkpoint-container>  # Required: checkpoint container name
EVENTHUB_CONNECTION_STRING=Endpoint=sb://<namespace>.servicebus.windows.net/;SharedAccessKeyName=...  # Alternative to Entra ID auth
AZURE_TOKEN_CREDENTIALS=prod  # Required only if DefaultAzureCredential is used in production

Authentication

csharp
using Azure.Identity;
using Azure.Messaging.EventHubs;
using Azure.Messaging.EventHubs.Producer;

// Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
var credential = new DefaultAzureCredential(
    DefaultAzureCredential.DefaultEnvironmentVariableName
);
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes
// var credential = new ManagedIdentityCredential();

var fullyQualifiedNamespace = Environment.GetEnvironmentVariable("EVENTHUB_FULLY_QUALIFIED_NAMESPACE");
var eventHubName = Environment.GetEnvironmentVariable("EVENTHUB_NAME");

var producer = new EventHubProducerClient(
    fullyQualifiedNamespace,
    eventHubName,
    credential);

Required RBAC Roles:

  • Sending: Azure Event Hubs Data Sender
  • Receiving: Azure Event Hubs Data Receiver
  • Both: Azure Event Hubs Data Owner

Client Types

ClientPurposeWhen to Use
EventHubProducerClientSend events immediately in batchesReal-time sending, full control over batching
EventHubBufferedProducerClientAutomatic batching with background sendingHigh-volume, fire-and-forget scenarios
EventHubConsumerClientSimple event readingPrototyping only, NOT for production
EventProcessorClientProduction event processingAlways use this for receiving in production

Core Workflow

1. Send Events (Batch)
csharp
using Azure.Identity;
using Azure.Messaging.EventHubs;
using Azure.Messaging.EventHubs.Producer;

await using var producer = new EventHubProducerClient(
    fullyQualifiedNamespace,
    eventHubName,
    new DefaultAzureCredential());

// Create a batch (respects size limits automatically)
using EventDataBatch batch = await producer.CreateBatchAsync();

// Add events to batch
var events = new[]
{
    new EventData(BinaryData.FromString("{\"id\": 1, \"message\": \"Hello\"}")),
    new EventData(BinaryData.FromString("{\"id\": 2, \"message\": \"World\"}"))
};

foreach (var eventData in events)
{
    if (!batch.TryAdd(eventData))
    {
        // Batch is full - send it and create a new one
        await producer.SendAsync(batch);
        batch = await producer.CreateBatchAsync();
        
        if (!batch.TryAdd(eventData))
        {
            throw new Exception("Event too large for empty batch");
        }
    }
}

// Send remaining events
if (batch.Count > 0)
{
    await producer.SendAsync(batch);
}
2. Send Events (Buffered - High Volume)
csharp
using Azure.Messaging.EventHubs.Producer;

var options = new EventHubBufferedProducerClientOptions
{
    MaximumWaitTime = TimeSpan.FromSeconds(1)
};

await using var producer = new EventHubBufferedProducerClient(
    fullyQualifiedNamespace,
    eventHubName,
    new DefaultAzureCredential(),
    options);

// Handle send success/failure
producer.SendEventBatchSucceededAsync += args =>
{
    Console.WriteLine($"Batch sent: {args.EventBatch.Count} events");
    return Task.CompletedTask;
};

producer.SendEventBatchFailedAsync += args =>
{
    Console.WriteLine($"Batch failed: {args.Exception.Message}");
    return Task.CompletedTask;
};

// Enqueue events (sent automatically in background)
for (int i = 0; i < 1000; i++)
{
    await producer.EnqueueEventAsync(new EventData($"Event {i}"));
}

// Flush remaining events before disposing
await producer.FlushAsync();
3. Receive Events (Production - EventProcessorClient)
csharp
using Azure.Identity;
using Azure.Messaging.EventHubs;
using Azure.Messaging.EventHubs.Consumer;
using Azure.Messaging.EventHubs.Processor;
using Azure.Storage.Blobs;

// Blob container for checkpointing
var blobClient = new BlobContainerClient(
    Environment.GetEnvironmentVariable("BLOB_STORAGE_CONNECTION_STRING"),
    Environment.GetEnvironmentVariable("BLOB_CONTAINER_NAME"));

await blobClient.CreateIfNotExistsAsync();

// Create processor
var processor = new EventProcessorClient(
    blobClient,
    EventHubConsumerClient.DefaultConsumerGroup,
    fullyQualifiedNamespace,
    eventHubName,
    new DefaultAzureCredential());

// Handle events
processor.ProcessEventAsync += async args =>
{
    Console.WriteLine($"Partition: {args.Partition.PartitionId}");
    Console.WriteLine($"Data: {args.Data.EventBody}");
    
    // Checkpoint after processing (or batch checkpoints)
    await args.UpdateCheckpointAsync();
};

// Handle errors
processor.ProcessErrorAsync += args =>
{
    Console.WriteLine($"Error: {args.Exception.Message}");
    Console.WriteLine($"Partition: {args.PartitionId}");
    return Task.CompletedTask;
};

// Start processing
await processor.StartProcessingAsync();

// Run until cancelled
await Task.Delay(Timeout.Infinite, cancellationToken);

// Stop gracefully
await processor.StopProcessingAsync();
4. Partition Operations
csharp
// Get partition IDs
string[] partitionIds = await producer.GetPartitionIdsAsync();

// Send to specific partition (use sparingly)
var options = new SendEventOptions
{
    PartitionId = "0"
};
await producer.SendAsync(events, options);

// Use partition key (recommended for ordering)
var batchOptions = new CreateBatchOptions
{
    PartitionKey = "customer-123"  // Events with same key go to same partition
};
using var batch = await producer.CreateBatchAsync(batchOptions);

EventPosition Options

Control where to start reading:

csharp
// Start from beginning
EventPosition.Earliest

// Start from end (new events only)
EventPosition.Latest

// Start from specific offset
EventPosition.FromOffset(12345)

// Start from specific sequence number
EventPosition.FromSequenceNumber(100)

// Start from specific time
EventPosition.FromEnqueuedTime(DateTimeOffset.UtcNow.AddHours(-1))

ASP.NET Core Integration

csharp
// Program.cs
using Azure.Identity;
using Azure.Messaging.EventHubs.Producer;
using Microsoft.Extensions.Azure;

builder.Services.AddAzureClients(clientBuilder =>
{
    clientBuilder.AddEventHubProducerClient(
        builder.Configuration["EventHub:FullyQualifiedNamespace"],
        builder.Configuration["EventHub:Name"]);
    
    clientBuilder.UseCredential(new DefaultAzureCredential());
});

// Inject in controller/service
public class EventService
{
    private readonly EventHubProducerClient _producer;
    
    public EventService(EventHubProducerClient producer)
    {
        _producer = producer;
    }
    
    public async Task SendAsync(string message)
    {
        using var batch = await _producer.CreateBatchAsync();
        batch.TryAdd(new EventData(message));
        await _producer.SendAsync(batch);
    }
}

Best Practices

  1. Use EventProcessorClient for receiving — Never use EventHubConsumerClient in production
  2. Checkpoint strategically — After N events or time interval, not every event
  3. Use partition keys — For ordering guarantees within a partition
  4. Reuse clients — Create once, use as singleton (thread-safe)
  5. Use await using — Ensures proper disposal
  6. Handle ProcessErrorAsync — Always register error handler
  7. Batch events — Use CreateBatchAsync() to respect size limits
  8. Use buffered producer — For high-volume scenarios with automatic batching

Error Handling

csharp
using Azure.Messaging.EventHubs;

try
{
    await producer.SendAsync(batch);
}
catch (EventHubsException ex) when (ex.Reason == EventHubsException.FailureReason.ServiceBusy)
{
    // Retry with backoff
    await Task.Delay(TimeSpan.FromSeconds(5));
}
catch (EventHubsException ex) when (ex.IsTransient)
{
    // Transient error - safe to retry
    Console.WriteLine($"Transient error: {ex.Message}");
}
catch (EventHubsException ex)
{
    // Non-transient error
    Console.WriteLine($"Error: {ex.Reason} - {ex.Message}");
}

Checkpointing Strategies

StrategyWhen to Use
Every eventLow volume, critical data
Every N eventsBalanced throughput/reliability
Time-basedConsistent checkpoint intervals
Batch completionAfter processing a logical batch
csharp
// Checkpoint every 100 events
private int _eventCount = 0;

processor.ProcessEventAsync += async args =>
{
    // Process event...
    
    _eventCount++;
    if (_eventCount >= 100)
    {
        await args.UpdateCheckpointAsync();
        _eventCount = 0;
    }
};
SDKPurposeInstall
Azure.Messaging.EventHubsCore sending/receivingdotnet add package Azure.Messaging.EventHubs
Azure.Messaging.EventHubs.ProcessorProduction processingdotnet add package Azure.Messaging.EventHubs.Processor
Azure.ResourceManager.EventHubsManagement plane (create hubs)dotnet add package Azure.ResourceManager.EventHubs
Microsoft.Azure.WebJobs.Extensions.EventHubsAzure Functions bindingdotnet add package Microsoft.Azure.WebJobs.Extensions.EventHubs

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/plugins/azure-sdk-dotnet/skills/azure-eventhub-dotnet of microsoft/skills.

Open the folder on GitHubat commit 3898ec8

Used in 5 other repositories

We found 14 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in microsoft/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Azure Eventhub Dotnet next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Azure Eventhub Dotnet compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure Eventhub Dotnet this skillmicrosoft/skills3.1k5 repos~2.7kAutomated safety check: PassMIT
Azure RelayMicrosoftDocs/Agent-Skills777—~1.1kAutomated safety check: PassCC-BY-4.0
Azure Messagingmicrosoft/GitHub-Copilot-for-Azure2551 repos~821Automated safety check: PassMIT
FoundatioFoundatioFx/Foundatio2.1k—~3.9kAutomated safety check: PassApache-2.0
Azure Functionsdavila7/claude-code-templates32k2 repos~344Automated safety check: PassMIT
Managedcode Storagemanagedcode/dotnet-skills486—~723Automated safety check: PassMIT

Similar skills

  • Azure Relay

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Relay development including troubleshooting, security, configuration, and integrations & coding patterns.

    777 GitHub stars~1.1k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Azure Messaging

    microsoft/GitHub-Copilot-for-Azure

    Official

    Troubleshoot and resolve issues with Azure Messaging SDKs for Event Hubs and Service Bus.

    255 GitHub starsUsed in 1 repo~821 tokens
    Data & AnalyticsAuto-check passed
  • Foundatio

    FoundatioFx/Foundatio

    A skill your agent uses when working with Foundatio infrastructure abstractions for .NET -- caching, queuing, messaging, file storage, distributed locking, or background jobs.

    2.1k GitHub stars~3.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Azure Functions

    davila7/claude-code-templates

    Expert patterns for Azure Functions development including isolated worker model, Durable Functions orchestration, cold start optimization, and production patterns.

    32k GitHub starsUsed in 2 repos~344 tokens
    Backend & APIsAuto-check passed
  • Managedcode Storage

    managedcode/dotnet-skills

    Use ManagedCode.Storage when a .NET application needs a provider-agnostic storage abstraction with explicit configuration, container selection, upload and download flows, and backend-specific…

    486 GitHub stars~723 tokensUpdated today
    Backend & APIsAuto-check passed
  • Azure Queue Storage

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Queue Storage development including best practices, limits & quotas, security, configuration, and integrations & coding patterns.

    777 GitHub stars~1.6k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed

More from microsoft/skills

All 150 skills in this repo
  • Official

    Covers producer, consumer, and checkpoint-store setup for Azure Event Hubs streaming in Python, with Entra ID auth and partition targeting.

    3.1k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Official

    Builds podcast-style audio narration from text with Azure OpenAI's GPT Realtime Mini over WebSocket, from a Python FastAPI backend to a React player.

    3.1k GitHub starsUsed in 1 repo~947 tokens
    Auto-check passed
  • Frontend UI Dark TS

    microsoft/skills

    Official

    Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations.

    3.1k GitHub starsUsed in 5 repos~3.6k tokens
    Auto-check passed
  • Pydantic Models Py

    microsoft/skills

    Official

    Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

    3.1k GitHub starsUsed in 5 repos~496 tokens
    Auto-check passed
  • Official

    Reference for building on Microsoft Foundry with the azure-ai-projects Python SDK: project clients, versioned agents, evaluations, connections, datasets and indexes.

    3.1k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Skill Creator

    microsoft/skills

    Official

    Guide for creating effective skills for AI coding agents working with Azure SDKs and Microsoft Foundry services.

    3.1k GitHub starsUsed in 5 repos~17k tokens
    Auto-check passed

Questions about Azure Eventhub Dotnet

What does Azure Eventhub Dotnet do?

Azure Event Hubs SDK for .NET. An agent skill from microsoft/skills. Azure Eventhub Dotnet is an agent skill from microsoft/skills, published by the product's own GitHub organization.NET.

When should I use Azure Eventhub Dotnet?

Azure Eventhub Dotnet fits situations like: high-throughput event streaming: sending events (EventHubProducerClient; eventHubBufferedProducerClient); receiving events (EventProcessorClient with checkpointing); partition management.

How do I install Azure Eventhub Dotnet in Claude Code?

Run `npx skills add microsoft/skills --skill azure-eventhub-dotnet -a claude-code`. Or copy the skill folder (.github/plugins/azure-sdk-dotnet/skills/azure-eventhub-dotnet in microsoft/skills) into .claude/skills/azure-eventhub-dotnet in your project. Claude Code loads it when a task matches its description.

How do I install Azure Eventhub Dotnet in Codex?

Run `npx skills add microsoft/skills --skill azure-eventhub-dotnet -a codex`. Or copy the skill folder (.github/plugins/azure-sdk-dotnet/skills/azure-eventhub-dotnet in microsoft/skills) into .agents/skills/azure-eventhub-dotnet in your project. Codex loads it when a task matches its description.

Can I use Azure Eventhub Dotnet in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/skills --skill azure-eventhub-dotnet -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/azure-eventhub-dotnet, .gemini/skills/azure-eventhub-dotnet, .github/skills/azure-eventhub-dotnet and .opencode/skills/azure-eventhub-dotnet in your project.

What does Azure Eventhub Dotnet need to run?

Going by SKILL.md and its folder, Azure Eventhub Dotnet needs the command-line tools its instructions call (dotnet) and credentials named AZURE_TOKEN_CREDENTIALS.

Does Azure Eventhub Dotnet access the network?

SKILL.md names 1 domain. In commands or code: learn.microsoft.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Azure Eventhub Dotnet safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Azure Eventhub Dotnet use?

Azure Eventhub Dotnet is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Azure Eventhub Dotnet use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Azure Eventhub Dotnet?

Skills that share tags, products or a category with Azure Eventhub Dotnet: Azure Relay (MicrosoftDocs/Agent-Skills, 777 stars), Azure Messaging (microsoft/GitHub-Copilot-for-Azure, 255 stars), Foundatio (FoundatioFx/Foundatio, 2.1k stars) and Azure Functions (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure Eventhub Dotnet?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,094 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 9, 2026.

Source: microsoft/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.