{"record":{"id":"36fe5742ced5470c","repo":"JuliusBrussee/caveman","slug":"azure-legacy-inference-path-q-is-not-supported","errorCode":null,"errorMessage":"azure legacy inference path %q is not supported","messagePattern":"azure legacy inference path %q is not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/providers/azureopenai/azure_routing.go","lineNumber":50,"sourceCode":"\tif err := validateAzureRequest(req.URL); err != nil {\n\t\treturn nil, err\n\t}\n\treturn a.Base.ResolveUpstreamURL(ctx, req, route)\n}\n\nfunc validateAzureRequest(u *url.URL) error {\n\tif foundryV1InferenceRoute(u.Path) {\n\t\tversions := u.Query()[\"api-version\"]\n\t\tif len(versions) > 1 {\n\t\t\treturn fmt.Errorf(\"azure request has duplicate api-version values\")\n\t\t}\n\t\tif len(versions) == 1 && versions[0] != \"v1\" && versions[0] != \"preview\" {\n\t\t\treturn fmt.Errorf(\"azure Foundry api-version %q is not supported\", versions[0])\n\t\t}\n\t\treturn nil\n\t}\n\tif !legacyChatCompletionsRoute(u.Path) {\n\t\treturn fmt.Errorf(\"azure legacy inference path %q is not supported\", u.Path)\n\t}\n\tversions := u.Query()[\"api-version\"]\n\tif len(versions) > 1 {\n\t\treturn fmt.Errorf(\"azure request has duplicate api-version values\")\n\t}\n\tversion := \"\"\n\tif len(versions) == 1 {\n\t\tversion = versions[0]\n\t}\n\tif version == \"\" {\n\t\treturn fmt.Errorf(\"azure request missing api-version\")\n\t}\n\tif !apiVersionAllowed(version) {\n\t\treturn fmt.Errorf(\"azure api-version %q is not on the allowlist\", version)\n\t}\n\treturn nil\n}\n","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/proxy/providers/azureopenai/azure_routing.go#L32-L68","documentation":"The adapter validates that the request path matches either the Foundry v1 inference route or the legacy chat-completions deployment route. Any other path shape is rejected. This error means the path was neither, so the adapter cannot resolve an upstream Azure endpoint for it.","triggerScenarios":"A request whose path (after the /azure prefix) is not /openai/v1/chat/completions, /openai/v1/responses, and not /openai/deployments/{deployment}/chat/completions — e.g. /openai/deployments/my-dep/embeddings or /openai/deployments/{dep}/chat/completions with an invalid deployment name containing characters outside [A-Za-z0-9._-] or longer than 128 chars.","commonSituations":"Pointing other OpenAI API surfaces (embeddings, images, completions) at the proxy; a deployment name with a slash or url-encoded characters that fails the strict legacy-route matcher; mistyped paths.","solutions":["Use only the supported paths: /azure/openai/v1/chat/completions, /azure/openai/v1/responses, or /azure/openai/deployments/{deployment}/chat/completions.","Check the deployment name: it must be 1-128 chars of [A-Za-z0-9._-]; rename or re-encode it.","If the endpoint is another Azure API surface, route it directly or through a provider/adapter that supports it."],"exampleFix":"// before\nPOST /azure/openai/deployments/my-deployment/embeddings\n// after\nPOST /azure/openai/deployments/my-deployment/chat/completions","handlingStrategy":"validation","validationCode":"func pathSupported(rawURL string) bool {\n\tu, _ := url.Parse(rawURL)\n\tp := strings.TrimPrefix(u.Path, \"/azure\")\n\tif p == \"/openai/v1/chat/completions\" || p == \"/openai/v1/responses\" {\n\t\treturn true\n\t}\n\tparts := strings.Split(strings.Trim(p, \"/\"), \"/\")\n\treturn len(parts) == 5 && parts[0] == \"openai\" && parts[1] == \"deployments\" &&\n\t\tparts[3] == \"chat\" && parts[4] == \"completions\"\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only call the proxy for chat completions and responses; route embeddings/images elsewhere.","Keep deployment names within [A-Za-z0-9._-] and <=128 chars.","Centralize Azure path construction in one helper instead of string concatenation at call sites."],"tags":["azure","openai","routing","path","validation"],"backgroundTag":"unsupported-operation","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}