Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

[Backport 5.2] Update Azure OpenAI provider to use azure go client and support additional auth methods (#58289)#58472

Merged
unknwon merged 5 commits into
5.2from
backport-58289-to-5.2
Nov 28, 2023
Merged

[Backport 5.2] Update Azure OpenAI provider to use azure go client and support additional auth methods (#58289)#58472
unknwon merged 5 commits into
5.2from
backport-58289-to-5.2

Conversation

@chwarwick

@chwarwick chwarwick commented Nov 21, 2023

Copy link
Copy Markdown
Contributor

Converts the Azure OpenAI provider to use Azure's go client for the purpose of supporting additional auth methods beyond the API Key. When the Access token is not specified AzureDefaultCredentials are used which are tried in the following order:

  1. EnvironmentCredential
  2. WorkloadIdentityCredential
  3. ManagedIdentityCredential
  4. AzureCLICredential - useful for local development authenticate via az login

resolves https://github.com/sourcegraph/sourcegraph/issues/58301

cc @sourcegraph/release-guild

Test plan

Update tests
Tested chat & autocomplete with both API Key and default credentials
Verified auth errors after az logout
Embedded multiple repos
Checked embeddings search results used with chat request

@cla-bot cla-bot Bot added the cla-signed label Nov 21, 2023
@sourcegraph-bot

sourcegraph-bot commented Nov 21, 2023

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@chwarwick chwarwick force-pushed the backport-58289-to-5.2 branch from f97d55f to b0b6357 Compare November 28, 2023 14:59
@chwarwick chwarwick requested review from a team and eseliger November 28, 2023 15:53
@unknwon unknwon merged commit 5e0d4cb into 5.2 Nov 28, 2023
@unknwon unknwon deleted the backport-58289-to-5.2 branch November 28, 2023 22:50
@varungandhi-src varungandhi-src mentioned this pull request Jan 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants