Azure Event Hubs for .NET
A practical .NET guide to high-throughput Azure Event Hubs production, consumption, partitioning, and checkpointing.
The skill documents Entra ID, connection-string alternatives, RBAC roles, and client reuse, but it does not clearly address least-privilege configuration beyond role names, secret protection, event-content logging risks, user confirmation, external-effect boundaries, or rollback. No red-line risk is visible, so the score is reduced.
It covers the main sending, buffered sending, processor receiving, partition, error-handling, and checkpointing paths, but static evidence cannot establish that they run. The batch example reassigns a variable declared with a using declaration, which may be a C# compilation problem; the DefaultAzureCredential construction is also questionable, and cancellation, retry, and concurrent checkpoint handling are thin. The score is therefore limited.
Trigger terms, SDK scope, sending and receiving scenarios, and the production processor recommendation are reasonably clear. However, non-fit boundaries, input/output constraints, compatibility limits, and Chinese-language guidance are incomplete. The core function depends on Azure services, with no mainland-China reachability, region, or service-availability guidance, so points are deducted.
The document provides a name, description, MIT license, version metadata, installation commands, environment variables, structured sections, examples, best practices, and related SDKs. It lacks a changelog, explicit maintenance ownership and update path, troubleshooting FAQs, dependency governance, and a known-limitations section, so full marks are not justified.
The material can serve as a practical reference for common Event Hubs .NET patterns and production receiving. Potential compilation or configuration issues, plus the absence of a verifiable complete project, tests, idempotency guidance, rebalancing details, dead-letter handling, and production operations coverage, mean users still need substantial review and correction.
Repository context shows CI, evaluation workflows, and test harness code, providing some audit signals. However, the supplied material does not show path-specific tests, evaluation results, or third-party execution evidence for this skill. Key code correctness therefore cannot be independently reproduced from static reading, limiting the score to 5 or below.
- Compile-check the batching example before adoption, especially whether reassignment of a variable declared with a using declaration is legal, and verify the actual DefaultAzureCredential constructor and AZURE_TOKEN_CREDENTIALS behavior.
- Do not commit or log connection strings; EventBody may contain sensitive data, so the sample console output should be reviewed against production data-classification and logging policies.
- Add guidance for cancellation, guaranteed processor shutdown, transient-error backoff, concurrent checkpointing, duplicate delivery, and mainland-China region and network reachability.
What it does & when to use it
This skill supports .NET developers building high-throughput streaming workflows with Azure.Messaging.EventHubs. It covers immediate batch producers, buffered background producers, and production consumption with EventProcessorClient and Blob Storage checkpoints. It also documents Entra ID authentication, connection-string alternatives, RBAC roles, event positions, partition keys, error handling, and ASP.NET Core integration. It is a strong fit for Azure Event Hubs applications, provided the project can supply the required Azure resources, credentials, packages, and permissions.
Provides installation commands for the Event Hubs, processor, Azure Identity, and Blob Storage NuGet packages; reads namespace, hub name, authentication, and checkpoint settings from environment variables; demonstrates EventHubProducerClient for size-aware batch sending; demonstrates EventHubBufferedProducerClient for automatic background batching and send callbacks; configures EventProcessorClient to consume by partition, handle processing errors, and update Blob Storage checkpoints; shows partition IDs, partition keys, EventPosition values, ASP.NET Core client registration, and EventHubsException handling.
- A .NET backend that must send events to Azure Event Hubs in controlled batches.
- A high-volume producer that benefits from automatic background batching and failure callbacks.
- A production consumer that needs partition-aware processing and Blob Storage checkpointing.
- A service that must preserve ordering for events sharing a customer or business key.
- An ASP.NET Core application that wants to register and reuse an Event Hubs producer through dependency injection.
Pros & cons
- Covers the main implementation path from package installation and authentication through sending, receiving, partitioning, checkpointing, and error handling.
- Clearly distinguishes immediate batch sending, buffered sending, simple consumption, and production processing.
- Includes copyable C# and dotnet command examples.
- Includes ASP.NET Core dependency injection and client-reuse guidance.
- The production receiving pattern depends on Blob Storage for checkpoint management.
- Successful deployment requires correct Azure credentials, environment variables, and RBAC assignments.
- The scope is Azure Event Hubs with the .NET SDK rather than other languages or general messaging platforms.
- The supplied material does not show dedicated test results for this individual skill, and the repository is still under active development.
How to install
Install the collection with npx skills add microsoft/skills, then select the required skill in the wizard. The collection is installed into the selected agent directory, such as .github/skills/ for GitHub Copilot. The supplied material does not document a dedicated command for installing only azure-eventhub-dotnet; its source file is .github/plugins/azure-sdk-dotnet/skills/azure-eventhub-dotnet/SKILL.md. For the .NET application, install the documented packages with dotnet add package Azure.Messaging.EventHubs, dotnet add package Azure.Messaging.EventHubs.Processor, dotnet add package Azure.Identity, and dotnet add package Azure.Storage.Blobs as needed.
How to use
After placing the skill where the agent can discover it, trigger it with a request such as: “Implement .NET Azure Event Hubs batch sending and production EventProcessorClient checkpointing for my service.” Before running the examples, configure EVENTHUB_FULLY_QUALIFIED_NAMESPACE, EVENTHUB_NAME, and the checkpoint-related variables. Assign Azure Event Hubs Data Sender, Azure Event Hubs Data Receiver, or Azure Event Hubs Data Owner as appropriate. Use EventProcessorClient for production receiving, configure a Blob Storage checkpoint container, and register both event and error handlers.
Compared to similar skills
EventProcessorClient is explicitly presented as the production receiving option, while EventHubConsumerClient is described as suitable only for prototyping. For sending, EventHubProducerClient provides immediate batch control, whereas EventHubBufferedProducerClient handles automatic background batching. For authentication, the examples emphasize DefaultAzureCredential while also documenting connection strings as an alternative.