azure-eventhub-rust
Azure Event Hubs library for Rust. Send and receive events for streaming data ingestion and batch processing. Triggers: "event hubs rust", "ProducerClient rust", "ConsumerClient rust", "send event rust", "streaming rust", "eventhub rust".
Install / Use
npx skills add microsoft/skills --skill azure-eventhub-rustInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
CommunicationSupported Platforms
Our assessment of azure-eventhub-rust
azure-eventhub-rust scores 93/100 on our quality scale, 108th of 308 Communication skills we index (top 36%).
Its SKILL.md is 6.7 KB long, well organised into 13 sections with 7 code examples: a thorough specification that gives an agent plenty to work with.
With 3,051 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 5 days ago, so azure-eventhub-rust is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-09-29. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
azure-eventhub-rust compared with similar skills
All 4 of these similar skills score higher than azure-eventhub-rust; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| azure-eventhub-rust (this skill)by microsoft | 93 | 3.1k | 5d ago | SKILL.md |
| algorithmic-artby anthropics | 100 | 177.9k | 6d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 6d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 130.2k | 7d ago | SKILL.md |
| ui-ux-pro-maxby nextlevelbuilder | 100 | 130.2k | 7d ago | SKILL.md |
Frequently asked questions
- How do I install azure-eventhub-rust?
- Run
npx skills add microsoft/skills --skill azure-eventhub-rust. The install tabs above show the steps for each supported agent. - Which AI agents does azure-eventhub-rust work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is azure-eventhub-rust safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is azure-eventhub-rust still maintained?
- The repository was last updated 5 days ago, so azure-eventhub-rust is actively maintained.
Skill content
View source on GitHubname: azure-eventhub-rust description: | Azure Event Hubs library for Rust. Send and receive events for streaming data ingestion and batch processing. Triggers: "event hubs rust", "ProducerClient rust", "ConsumerClient rust", "send event rust", "streaming rust", "eventhub rust". license: MIT metadata: author: Microsoft package: azure_messaging_eventhubs
Azure Event Hubs library for Rust
Client library for Azure Event Hubs — send and receive events for streaming data ingestion.
Use this skill when:
- An app needs to send events to Azure Event Hubs from Rust
- You need to receive and process events from partitions
- You need batch sending for throughput optimization
- You need to control consumer start position
IMPORTANT: Only use the official
azure_messaging_eventhubscrate published by the azure-sdk crates.io user. Do NOT use unofficial or community crates. Official crates use underscores in names and none have version 0.21.0.
Installation
cargo add azure_messaging_eventhubs azure_identity tokio futures
DeveloperToolsCredential::new(None)?already returns anArc<DeveloperToolsCredential>, so you can pass or clone it directly into.open(). Addazure_coreonly when you need directazure_coreimports such asErrorKind.
Environment Variables
EVENTHUBS_HOST=<namespace>.servicebus.windows.net # Required — fully qualified namespace
EVENTHUB_NAME=<eventhub-name> # Required — name of the Event Hub
Key Concepts
| Concept | Description |
| ------------- | ---------------------------------------------------- |
| Namespace | Container for one or more Event Hubs |
| Event Hub | Stream of events, partitioned for parallel reads |
| Partition | Ordered, append-only sequence of events |
| Producer | Sends events via ProducerClient |
| Consumer | Receives events from partitions via ConsumerClient |
Authentication
Rust Azure SDK code must not use DefaultAzureCredential. The Rust identity crate does not provide that type.
use azure_identity::DeveloperToolsCredential;
use azure_messaging_eventhubs::ProducerClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential.
let credential = DeveloperToolsCredential::new(None)?;
let producer = ProducerClient::builder()
.open(
"<namespace>.servicebus.windows.net",
"<eventhub-name>",
credential.clone(),
)
.await?;
Ok(())
}
Prefer the crate README/examples when checking builder signatures and receive-stream event wrapper shapes.
Core Workflow
Send Events
// Send a single event
producer.send_event(vec![1, 2, 3, 4], None).await?;
Send Batch
let batch = producer.create_batch(None).await?;
batch.try_add_event_data(vec![1, 2, 3, 4], None)?;
producer.send_batch(batch, None).await?;
Receive Events
use azure_identity::DeveloperToolsCredential;
use azure_messaging_eventhubs::ConsumerClient;
// Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential.
let credential = DeveloperToolsCredential::new(None)?;
let consumer = ConsumerClient::builder()
.open(
"<namespace>.servicebus.windows.net",
"<eventhub-name>".to_string(),
credential.clone(),
)
.await?;
Receive from Partition
use futures::stream::StreamExt;
use azure_messaging_eventhubs::{
ConsumerClient, OpenReceiverOptions, StartLocation, StartPosition,
};
let receiver = consumer
.open_receiver_on_partition(
"0".to_string(),
Some(OpenReceiverOptions {
start_position: Some(StartPosition {
location: StartLocation::Earliest,
..Default::default()
}),
..Default::default()
}),
)
.await?;
let mut stream = receiver.stream_events();
while let Some(event_result) = stream.next().await {
match event_result {
// Body is on the inner event data, not the received wrapper: `event.event_data().body()`.
Ok(event) => {
let body = event.event_data().body().unwrap_or_default();
println!("Received: {:?}", body);
}
Err(err) => eprintln!("Error: {:?}", err),
}
}
RBAC Roles
For Entra ID auth, assign one of these roles:
| Role | Access |
| -------------------------------- | -------------- |
| Azure Event Hubs Data Sender | Send events |
| Azure Event Hubs Data Receiver | Receive events |
| Azure Event Hubs Data Owner | Full access |
Best Practices
- Use
cargo addto manage dependencies, never editCargo.tomldirectly. Add and remove Rust SDK dependencies with cargo commands instead of manual manifest edits. - Pass or clone credentials directly into
.open().DeveloperToolsCredential::new(None)?already returns anArc, so you do not need to annotate the binding asArc<dyn TokenCredential>unless you are naming that trait object type explicitly. - Match the builder signature.
ProducerClient::builder().open(...)takes the hub name as&str, whileConsumerClient::builder().open(...)takes an ownedString. - Use
DeveloperToolsCredentialfor local dev,ManagedIdentityCredentialfor production — Rust does not provide a singleDefaultAzureCredentialtype - Never hardcode credentials — use environment variables or managed identity
- Use batching —
create_batch+send_batchfor throughput optimization - Handle errors per event — match on
Ok/Errin the event stream - Extract event bodies via
event.event_data().body(), notevent.body()—ReceivedEventDatawraps the underlyingEventData. - Specify start position — use
StartLocation::EarliestorStartLocation::Latestto control where consumption begins - Run
cargo clippy -- -D warningswhen the prompt, eval, or CI expects lint-clean output
Reference Links
| Resource | Link | | ------------- | --------------------------------------------------------------------------------------------- | | API Reference | https://docs.rs/azure_messaging_eventhubs/latest/azure_messaging_eventhubs | | crates.io | https://crates.io/crates/azure_messaging_eventhubs | | Source Code | https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/eventhubs/azure_messaging_eventhubs |
Related Skills
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
130.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
ui-ux-pro-max
130.2kUI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
