-
Notifications
You must be signed in to change notification settings - Fork 720
Event Hubs: Update EventProcessorClient component to pull BlobClient from DI #3293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eerhardt
merged 11 commits into
dotnet:main
from
oising:eventhubprocessor-blobclient-di
Apr 12, 2024
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7ee7079
update sample EH project launchsettings; add blob component for proce…
oising cb41779
update azurecomponent to expose serviceprovider; update associated co…
oising 353f06e
Merge branch 'main' into eventhubprocessor-blobclient-di
oising 5340dbc
throw if blobclient cannot be retrieved from DI (this is a breaking c…
oising 0607243
fix tests
oising 3ab5fb7
PR feedback
eerhardt 3a7ba4c
More PR feedback
sebastienros 28b20c7
Merge remote-tracking branch 'upstream/main' into eventhubprocessor-b…
eerhardt 638a4bb
Rename BlobClientConnectionName to BlobClientServiceKey.
eerhardt 0a4f028
fix tests
eerhardt a0b0d8c
fixup formatting
eerhardt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
33 changes: 31 additions & 2 deletions
33
playground/AspireEventHub/EventHubs.AppHost/Properties/launchSettings.json
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no available method that provides options, cred, provider and requiresCredential. The ultimate private call has these but there is no public combination that allows to access it. Ideally on AddClient since this is the one we wanted. I assume the expectation was that if you provide a factory with
TokenCredentialyou'd wantrequiresCredential: truebut here we don't always.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to successfully use this using a connection string. So I'm not sure we need to specify
requiresCredential: false. Since this is a new component, we shouldn't be breaking anyone. But let's keep the other components doing what they are doing now. This one can use AddClient.@tg-msft - do you know what this
requiresCredentialbool does/means exactly? Why can't I specifyrequiresCredential: falsewhen I use the overloads with IServiceProvider?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is the problem I had -- there was no public overload available that allowed specifying it when you want the service provider. I couldn't immediately see what the point of this flag even was, so I figured it was vestigial as everything seemed to work regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requiresCredential is a niche feature for services that allow anonymous auth (i.e., reads on a Storage account used for hosting static websites). I believe it only controls whether or not we throw an exception when resolving a client if there was no credential provided. https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/extensions/Microsoft.Extensions.Azure/src/Internal/ClientRegistration.cs#L46