Update DI for constructor overhaul: shared credential + AzureCliCredential for local dev#36
Closed
Update DI for constructor overhaul: shared credential + AzureCliCredential for local dev#36
Conversation
- Move ManagedIdentityClientId from per-connector to shared ConnectorOptions - Add UseAzureCliCredential option for local development - Register TokenCredential as singleton in DI (AzureCliCredential for local, ManagedIdentityCredential for Azure) - Simplify client registration to pass credential explicitly - Remove per-connector ManagedIdentityClientId properties Companion to Azure/Connectors-NET-SDK#112
There was a problem hiding this comment.
Pull request overview
This PR updates the DirectConnector Azure Functions sample to use a single shared TokenCredential instance for all generated connector clients, with support for AzureCliCredential in local development scenarios. It also introduces shared (cross-connector) identity configuration via ConnectorOptions.
Changes:
- Register a singleton
TokenCredentialin DI, selecting betweenAzureCliCredential(local dev) and managed identity (Azure). - Simplify all connector client DI registrations to pass the shared credential explicitly.
- Extend
ConnectorOptionswith sharedUseAzureCliCredentialandManagedIdentityClientIdsettings.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| DirectConnector/Program.cs | Registers a shared TokenCredential singleton and passes it into each connector client registration. |
| DirectConnector/Configuration/ConnectorOptions.cs | Adds shared credential-related settings; currently introduces duplicated option type declarations. |
Co-authored-by: Dobby <dobby@microsoft.com>
Member
Author
|
Closing — superseded by #40 which consolidates all SDK v0.9.0-preview.1 breaking changes, namespace migrations, and new features into a single PR. |
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.
Update DI pattern to use shared credential with AzureCliCredential for local dev.
Companion to Azure/Connectors-NET-SDK#112