azure-eventhub-rust-303a99 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited azure-eventhub-rust-303a99 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Client library for Azure Event Hubs — send and receive events for streaming data ingestion.
Use this skill when:
IMPORTANT: Only use the official azure_messaging_eventhubs crate 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.cargo add azure_messaging_eventhubs azure_identity tokio futuresDeveloperToolsCredential::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.
EVENTHUBS_HOST=<namespace>.servicebus.windows.net # Required — fully qualified namespace
EVENTHUB_NAME=<eventhub-name> # Required — name of the Event Hub| 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 |
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.
// Send a single event
producer.send_event(vec![1, 2, 3, 4], None).await?;let batch = producer.create_batch(None).await?;
batch.try_add_event_data(vec![1, 2, 3, 4], None)?;
producer.send_batch(batch, None).await?;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?;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),
}
}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 |
DeveloperToolsCredential::new(None)? already returns an Arc, so you do not need to annotate the binding as Arc<dyn TokenCredential> unless you are naming that trait object type explicitly.ProducerClient::builder().open(...) takes the hub name as &str, while ConsumerClient::builder().open(...) takes an owned String.DefaultAzureCredential typecreate_batch + send_batch for throughput optimizationOk/Err in the event streamevent.body() — ReceivedEventData wraps the underlying EventData.StartLocation::Earliest or StartLocation::Latest to control where consumption begins| 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 |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.