Skip to content

Update DI for constructor overhaul: shared credential + AzureCliCredential for local dev#36

Closed
daviburg wants to merge 2 commits intomainfrom
feature/constructor-overhaul
Closed

Update DI for constructor overhaul: shared credential + AzureCliCredential for local dev#36
daviburg wants to merge 2 commits intomainfrom
feature/constructor-overhaul

Conversation

@daviburg
Copy link
Copy Markdown
Member

@daviburg daviburg commented May 7, 2026

Update DI pattern to use shared credential with AzureCliCredential for local dev.

  • Move ManagedIdentityClientId from per-connector to shared ConnectorOptions
  • Add UseAzureCliCredential option for local development
  • Register TokenCredential as singleton in DI
  • Simplify all client registrations to pass credential explicitly

Companion to Azure/Connectors-NET-SDK#112

- 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
@daviburg daviburg requested a review from a team as a code owner May 7, 2026 05:39
Copilot AI review requested due to automatic review settings May 7, 2026 06:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TokenCredential in DI, selecting between AzureCliCredential (local dev) and managed identity (Azure).
  • Simplify all connector client DI registrations to pass the shared credential explicitly.
  • Extend ConnectorOptions with shared UseAzureCliCredential and ManagedIdentityClientId settings.

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.

Comment thread DirectConnector/Configuration/ConnectorOptions.cs
Comment thread DirectConnector/Configuration/ConnectorOptions.cs
Co-authored-by: Dobby <dobby@microsoft.com>
@daviburg
Copy link
Copy Markdown
Member Author

daviburg commented May 8, 2026

Closing — superseded by #40 which consolidates all SDK v0.9.0-preview.1 breaking changes, namespace migrations, and new features into a single PR.

@daviburg daviburg closed this May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants