Support Responses API in Azure BYOK#322845
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Azure BYOK (Bring Your Own Key) Entra-authenticated request shaping when users configure an explicit Responses API URL (including APIM vanity domains). It adds a small helper to detect Responses URLs and ensures the Entra auth path sets modelInfo.supported_endpoints so the request body uses input (Responses) instead of messages (Chat Completions).
Changes:
- Add
azureSupportedEndpointsForUrl(url)to detect/responsesURLs and advertise Responses support viasupported_endpoints. - Apply the helper in the Azure Entra auth path so request bodies are shaped for the Responses API when appropriate.
- Add unit tests covering APIM
/responsesURL preservation and supported-endpoints detection.
Show a summary per file
| File | Description |
|---|---|
extensions/copilot/src/extension/byok/vscode-node/azureProvider.ts |
Adds azureSupportedEndpointsForUrl and uses it in the Entra auth flow to set modelInfo.supported_endpoints for Responses API URLs. |
extensions/copilot/src/extension/byok/vscode-node/test/azureProvider.spec.ts |
Adds tests for APIM /responses URL preservation and for supported-endpoints detection behavior. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 2
roblourens
approved these changes
Jun 24, 2026
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.
Fixes #318114
When using an Azure BYOK model with Entra auth and a Responses API URL (e.g. behind APIM), VS Code was sending
Chat Completions request bodies (
messages) instead of Responses bodies (input), which Azure rejects with:Cause
The Entra auth path in
azureProvider.tsbuilds itsmodelInfomanually and never setsupported_endpoints, so the endpoint defaulted to ChatCompletions. The API-key path already marked Responses URLs correctly.
Fix
Extracted a small testable helper
azureSupportedEndpointsForUrl(url)that returns[ChatCompletions, Responses]for/responsesURLs (including APIM vanity domains) andundefinedotherwise. The Entra path now applies it tomodelInfo.supported_endpoints, mirroring the existing API-key behavior.