Skip to content

Add EntraId authentication support for Azure specific endpoints#2070

Merged
eleanorjboyd merged 10 commits intomicrosoft:mainfrom
eleanorjboyd:unwilling-duck
Nov 21, 2025
Merged

Add EntraId authentication support for Azure specific endpoints#2070
eleanorjboyd merged 10 commits intomicrosoft:mainfrom
eleanorjboyd:unwilling-duck

Conversation

@eleanorjboyd
Copy link
Member

Copilot AI review requested due to automatic review settings November 18, 2025 22:12
@eleanorjboyd eleanorjboyd self-assigned this Nov 18, 2025
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 18, 2025
Copy link
Contributor

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 adds Entra ID authentication support for Azure OpenAI endpoints, allowing users to authenticate with their Azure credentials instead of API keys for enterprise security scenarios.

Key changes:

  • Adds a new configuration setting github.copilot.chat.azureAuthType to choose between Entra ID and API key authentication (defaults to Entra ID)
  • Creates a new AzureOpenAIEndpoint class that uses Bearer token authentication instead of Azure's api-key header
  • Updates AzureBYOKModelProvider to handle Entra ID authentication flows during model enumeration and chat responses
  • Includes comprehensive unit tests for the new AzureOpenAIEndpoint class

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/platform/configuration/common/configurationService.ts Adds AzureAuthType configuration setting to support choosing between 'entraId' and 'apiKey' authentication methods
src/extension/byok/vscode-node/customOAIProvider.ts Exports CustomOAIModelInfo interface and renames getModelsWithAPIKeys to getModelsWithCredentials (changed visibility to protected) for extensibility
src/extension/byok/vscode-node/azureProvider.ts Implements Entra ID authentication by overriding getModelsWithCredentials and provideLanguageModelChatResponse to use Azure authentication sessions
src/extension/byok/node/azureOpenAIEndpoint.ts New class extending OpenAIEndpoint to override header generation, using Authorization: Bearer instead of api-key for Entra ID tokens
src/extension/byok/node/test/azureOpenAIEndpoint.spec.ts Comprehensive unit tests covering Entra ID authentication headers and endpoint behavior
package.json Adds the github.copilot.chat.azureAuthType configuration schema with enum values and documentation

Copy link
Contributor

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

lramos15
lramos15 previously approved these changes Nov 20, 2025
{ createIfNone: true }
{
createIfNone: true,
silent: false
Copy link
Member

Choose a reason for hiding this comment

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

redundant


if (authType === AzureAuthMode.EntraId) {
const session = await vscode.authentication.getSession(
// Session is guaranteed to be defined when createIfNone: true
Copy link
Member

Choose a reason for hiding this comment

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

the typing for getSession should say this already.

@eleanorjboyd eleanorjboyd added this pull request to the merge queue Nov 21, 2025
Merged via the queue into microsoft:main with commit e43564a Nov 21, 2025
6 checks passed
@eleanorjboyd eleanorjboyd deleted the unwilling-duck branch November 21, 2025 19:48
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.

Support Entra to authenticate to Azure models

5 participants