-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Improve client registration guidance #49938
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
base: main
Are you sure you want to change the base?
Improve client registration guidance #49938
Conversation
|
|
||
| // Set a credential for all clients to use by default | ||
| DefaultAzureCredential credential = new(); | ||
| clientBuilder.UseCredential(credential); |
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 believe this implementation needs to stay due to the custom client factory.
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.
@jsquire The AOAI client registration below should use the same DefaultAzureCredential. With that in mind, how do you advise we update this code sample?
@alexwolfmsft It doesn't need to happen in this PR, but the AOAI package should be replaced with OAI.
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.
The OpenAI registration should be updated, one of the ignored parameters from the factory is the credential to use:
lientBuilder.AddClient<AzureOpenAIClient, AzureOpenAIClientOptions>(
(options, omgUseThisCredential, _) =>new AzureOpenAIClient(
new Uri("<url_here>"), omgUseThisCredential, options)); If we do that the right way, then we can keep or kill UseCredential because we're not relying on the closure scope.
|
|
||
| // Set a credential for all clients to use by default | ||
| DefaultAzureCredential credential = new(); | ||
| clientBuilder.UseCredential(credential); |
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.
Same as above
Summary
Describe your changes here.
Fixes #Issue_Number (if available)
Internal previews