feat(eventhubs): restore connection string authentication - #7296
Merged
Sagar Patel (sagar0207) merged 5 commits intoAug 8, 2026
Conversation
Copilot-Session: f65b70a0-d52e-48a7-84f7-826ff4b091c5
Copilot-Session: f65b70a0-d52e-48a7-84f7-826ff4b091c5
Copilot-Session: f65b70a0-d52e-48a7-84f7-826ff4b091c5
|
Azure Pipelines: Successfully started running 3 pipeline(s). 7 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Restores connection-string authentication for Event Hubs ProducerClient and ConsumerClient, including SAS token support on the Rust AMQP backend and emulator-specific behavior.
Changes:
- Reintroduced connection-string constructors and EntityPath validation/selection in both clients.
- Implemented SAS token generation + CBS SAS token-type support for the Rust AMQP backend.
- Added offline/live tests and refreshed samples + README/changelog documentation.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/eventhubs/azure-messaging-eventhubs/test/ut/connection_string_test.cpp | Adds focused unit + opt-in live round-trip tests for connection-string behavior. |
| sdk/eventhubs/azure-messaging-eventhubs/test/ut/CMakeLists.txt | Includes the new connection-string unit tests in the test target. |
| sdk/eventhubs/azure-messaging-eventhubs/src/producer_client.cpp | Restores connection-string constructor logic (EntityPath + emulator port handling). |
| sdk/eventhubs/azure-messaging-eventhubs/src/consumer_client.cpp | Restores connection-string constructor logic (EntityPath + emulator port handling). |
| sdk/eventhubs/azure-messaging-eventhubs/samples/produce-events/produce_events.cpp | Adds a connection-string “produce events” sample. |
| sdk/eventhubs/azure-messaging-eventhubs/samples/produce-events/CMakeLists.txt | Adjusts sample build macro usage; disables automatic run for conn-string sample. |
| sdk/eventhubs/azure-messaging-eventhubs/samples/consume-events/consume_events.cpp | Adds a connection-string “consume events” sample. |
| sdk/eventhubs/azure-messaging-eventhubs/samples/consume-events/CMakeLists.txt | Adjusts sample build macro usage; disables automatic run for conn-string sample. |
| sdk/eventhubs/azure-messaging-eventhubs/samples/basic-operations/create_producer.cpp | Restores a basic connection-string producer sample. |
| sdk/eventhubs/azure-messaging-eventhubs/samples/basic-operations/create_consumer.cpp | Restores a basic connection-string consumer sample. |
| sdk/eventhubs/azure-messaging-eventhubs/samples/basic-operations/CMakeLists.txt | Adjusts sample build macro usage; disables automatic run for conn-string samples. |
| sdk/eventhubs/azure-messaging-eventhubs/samples/README.md | Updates environment variables and sample list naming/descriptions. |
| sdk/eventhubs/azure-messaging-eventhubs/inc/azure/messaging/eventhubs/producer_client.hpp | Adds public connection-string constructor + docs. |
| sdk/eventhubs/azure-messaging-eventhubs/inc/azure/messaging/eventhubs/consumer_client.hpp | Adds public connection-string constructor + docs. |
| sdk/eventhubs/azure-messaging-eventhubs/README.md | Updates auth guidance + modern send/receive examples and conn-string formats. |
| sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md | Records restored connection-string auth + Rust backend support. |
| sdk/core/azure-core-amqp/test/ut/connection_string_tests.cpp | Adds a fixed-vector SAS token test shared across backends; refactors existing tests. |
| sdk/core/azure-core-amqp/src/impl/rust_amqp/rust_amqp/rust_wrapper/src/amqp/sas.rs | Implements Rust SAS token generation + percent-encoding compatible with uAMQP. |
| sdk/core/azure-core-amqp/src/impl/rust_amqp/rust_amqp/rust_wrapper/src/amqp/mod.rs | Exposes the new Rust sas module. |
| sdk/core/azure-core-amqp/src/impl/rust_amqp/rust_amqp/rust_wrapper/src/amqp/cbs.rs | Extends Rust CBS authorize API to accept token type (JWT vs SAS). |
| sdk/core/azure-core-amqp/src/impl/rust_amqp/rust_amqp/rust_wrapper/Cargo.toml | Adds Rust crypto dependencies for SAS (base64/hmac/sha2). |
| sdk/core/azure-core-amqp/src/impl/rust_amqp/amqp/connection_string_credential.cpp | Implements Rust-backend SAS token generation via Rust interop. |
| sdk/core/azure-core-amqp/src/impl/rust_amqp/amqp/claim_based_security.cpp | Adds SAS token type support for Rust-backend CBS authorize calls. |
| sdk/core/azure-core-amqp/inc/azure/core/amqp/internal/connection_string_credential.hpp | Adds test-only friend access for fixed-vector SAS token testing. |
| sdk/core/azure-core-amqp/CHANGELOG.md | Notes Rust backend SAS token generation + CBS token-type behavior. |
Centralize connection string handling and harden Rust CBS FFI validation. Copilot-Session: f65b70a0-d52e-48a7-84f7-826ff4b091c5
Sagar Patel (sagar0207)
requested a review
from Amit Bhatia (meetamitbhatia)
as a code owner
August 7, 2026 18:07
Johnathan W (j7nw4r)
approved these changes
Aug 7, 2026
Sagar Patel (sagar0207)
enabled auto-merge (squash)
August 7, 2026 20:20
Larry Osterman (LarryOsterman)
approved these changes
Aug 8, 2026
Sagar Patel (sagar0207)
deleted the
sagar0207/eventhubs-connection-string-auth
branch
August 8, 2026 20:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restore connection-string authentication for the Event Hubs
ProducerClientandConsumerClient.The constructors were available through
1.0.0-beta.10and were removed in1.0.0-beta.11during the Rust AMQP merge. The connection-string parser and SAS credential remained, but the Rust backend's token generation and CBS SAS-token handling were incomplete.Fixes #7250 and #7295.
Azure DevOps work item: 39045651
Supersedes #7293. That PR came from a personal fork, so its CI jobs could not access the internal Azure Rust Cargo feed.
Related earlier draft: #7251.
Changes
Restored the previous public constructor signatures:
Reused
ServiceBusSasConnectionStringCredentialand the existing uAMQP CBS SAS-token path.Added SAS support to the default Rust AMQP backend:
servicebus.windows.net:sastokenthrough the Rust CBS path.Restored
EntityPathbehavior:EntityPath.std::invalid_argument.EntityPath.Restored Event Hubs emulator support:
Added focused offline tests, a shared fixed-vector token test, and an opt-in live round-trip test.
Restored and updated four connection-string samples:
create_producer.cppcreate_consumer.cppproduce_events.cppconsume_events.cppKept those samples in compile coverage but excluded them from automatic live sample execution because the standard live resources do not expose a connection string.
Updated the package README with:
EntityPath.Updated the samples README and changelog.
Validation
The branch was rebased onto current
mainat847ae28b6.uAMQP
Event Hubs emulator
The focused round-trip test passed on both uAMQP and Rust AMQP against the Docker Event Hubs emulator using the official connection-string shape without an explicit port.
The test opened the receiver, sent one event, received it, and compared the event body.
Azure Event Hubs
The focused round-trip test passed on both uAMQP and Rust AMQP against:
cpp-connscale-nseh-connscale-testing$DefaultThe connection string was held only in process memory and removed after the test.
Rust AMQP
Scope
This PR does not:
BlobCheckpointStoreconstructor.Security