{"record":{"id":"2c19d0c729452f56","repo":"microsoft/vscode","slug":"unrecognized-azure-deployment-url-url","errorCode":null,"errorMessage":"Unrecognized Azure deployment URL: ${url}","messagePattern":"Unrecognized Azure deployment URL: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/byok/vscode-node/azureProvider.ts","lineNumber":44,"sourceCode":"\n\t// Remove the trailing slash\n\tif (url.endsWith('/')) {\n\t\turl = url.slice(0, -1);\n\t}\n\t// if url ends with `/v1` remove it\n\tif (url.endsWith('/v1')) {\n\t\turl = url.slice(0, -3);\n\t}\n\n\t// Default to chat completions for base URLs\n\tconst defaultApiPath = '/chat/completions';\n\n\tif (url.includes('models.ai.azure.com') || url.includes('inference.ml.azure.com')) {\n\t\treturn `${url}/v1${defaultApiPath}`;\n\t} else if (url.includes('openai.azure.com')) {\n\t\treturn `${url}/openai/deployments/${modelId}${defaultApiPath}?api-version=2025-01-01-preview`;\n\t} else {\n\t\tthrow new Error(`Unrecognized Azure deployment URL: ${url}`);\n\t}\n}\n\n/**\n * Determines the `supported_endpoints` for a resolved Azure BYOK URL. When the URL targets the\n * Responses API, both Chat Completions and Responses are advertised so a Responses-shaped body\n * (`input`) is sent; otherwise `undefined` preserves the default Chat Completions behavior. This\n * keeps the Entra auth path consistent with the API-key path (issue #318114).\n */\nexport function azureSupportedEndpointsForUrl(url: string): ModelSupportedEndpoint[] | undefined {\n\tlet pathname: string;\n\ttry {\n\t\tpathname = new URL(url).pathname;\n\t} catch {\n\t\t// Tolerate malformed URLs by preserving the default Chat Completions behavior.\n\t\treturn undefined;\n\t}\n\t// Match the final path segment so a deployment named \"responses\" (e.g.","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/byok/vscode-node/azureProvider.ts#L26-L62","documentation":"Error \"Unrecognized Azure deployment URL: ${url}\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/byok/vscode-node/azureProvider.ts:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"a94b963a32aa9749d69504576791fa29700ae46d","analyzedAt":"2026-08-12T01:08:56.794Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}