{"record":{"id":"458a49b90b22d4ab","repo":"continuedev/continue","slug":"env-deployment-is-a-required-configuration-prope","errorCode":null,"errorMessage":"`env.deployment` is a required configuration property for Azure OpenAI","messagePattern":"`env\\.deployment` is a required configuration property for Azure OpenAI","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/openai-adapters/src/apis/Azure.ts","lineNumber":56,"sourceCode":"  private _getAzureBaseURL(config: z.infer<typeof AzureConfigSchema>): {\n    baseURL: string;\n    defaultQuery: Record<string, string>;\n  } {\n    const url = new URL(this.apiBase);\n\n    // Copy search params to separate object for OpenAI\n    const queryParams: Record<string, string> = {};\n    for (const [key, value] of url.searchParams.entries()) {\n      queryParams[key] = value;\n    }\n\n    url.pathname = url.pathname.replace(/\\/$/, \"\"); // Remove trailing slash if present\n    url.search = \"\"; // Clear original search params\n\n    // Default is `azure-openai` in docs, but previously was `azure`\n    if (this._isAzureOpenAI(config.env?.apiType)) {\n      if (!config.env?.deployment) {\n        throw new Error(\n          \"`env.deployment` is a required configuration property for Azure OpenAI\",\n        );\n      }\n\n      if (!config.env?.apiVersion) {\n        throw new Error(\n          \"`env.apiVersion` is a required configuration property for Azure OpenAI\",\n        );\n      }\n\n      const basePathname = `openai/deployments/${config.env.deployment}`;\n\n      url.pathname =\n        url.pathname === \"/\" ? basePathname : `${url.pathname}/${basePathname}`;\n\n      queryParams[\"api-version\"] = config.env.apiVersion;\n    }\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/openai-adapters/src/apis/Azure.ts#L38-L74","documentation":"When the Azure adapter is configured with apiType 'azure-openai' (Azure's native deployment-based API rather than the azure-api-key gateway mode), it builds a /openai/deployments/{deployment}/... URL and therefore requires a deployment name. This constructor-time validation in _getAzureBaseURL throws if env.deployment is missing so the request fails before hitting the network with a confusing 404.","triggerScenarios":"Setting apiType: 'azure-openai' (or relying on the newer default) in config.env without a deployment property; _getAzureBaseURL is invoked via the baseURL/defaultQuery getters whenever a request is prepared.","commonSituations":"Migrating from the legacy apiType 'azure' (which used model-name URLs) to 'azure-openai' and not adding deployment; using the Azure OpenAI v1 API where deployments are named separately from model names; typos like deployName or deploymentName instead of deployment.","solutions":["Add env.deployment set to your Azure deployment name (not the model name) in the Azure config","Confirm you actually want the azure-openai apiType; if using the azure-api-key gateway mode, set apiType: 'azure-api-key' instead","Verify the deployment name in Azure Portal under Azure OpenAI -> Deployments"],"exampleFix":"// before\n{ provider: 'azure', apiType: 'azure-openai', apiKey: '...', apiVersion: '2024-02-01' }\n\n// after\n{ provider: 'azure', apiType: 'azure-openai', apiKey: '...', apiVersion: '2024-02-01', deployment: 'my-gpt4o-deployment' }","handlingStrategy":"validation","validationCode":"if (config.provider === 'azure' && config.env?.apiType !== 'azure-api-key') {\n  if (!config.env?.deployment) {\n    throw new ConfigError('azure-openai requires env.deployment');\n  }\n}","typeGuard":"const isCompleteAzureConfig = (c: AzureConfig): boolean =>\n  c.env?.apiType === 'azure-api-key' || Boolean(c.env?.deployment && c.env?.apiVersion);","tryCatchPattern":"try { new AzureApi(config); } catch (e) {\n  if (e instanceof Error && e.message.includes('env.deployment')) {\n    // prompt user for deployment name or fall back to gateway mode\n  }\n  throw e;\n}","preventionTips":["Validate azure config at load time with a schema (zod) requiring deployment+apiVersion when apiType is azure-openai","Keep a checklist when migrating apiType from 'azure' to 'azure-openai': add deployment and apiVersion"],"tags":["azure","openai","config","deployment","required-field"],"backgroundTag":"missing-required-config","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}