{"record":{"id":"8ad4f19942fa9901","repo":"Mintplex-Labs/anything-llm","slug":"no-azure-api-endpoint-was-set-8ad4f1","errorCode":null,"errorMessage":"No Azure API endpoint was set.","messagePattern":"No Azure API endpoint was set\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/utils/EmbeddingEngines/azureOpenAi/index.js","lineNumber":7,"sourceCode":"const { toChunks, reportEmbeddingProgress } = require(\"../../helpers\");\n\nclass AzureOpenAiEmbedder {\n  constructor() {\n    const { AzureOpenAI } = require(\"openai\");\n    if (!process.env.AZURE_OPENAI_ENDPOINT)\n      throw new Error(\"No Azure API endpoint was set.\");\n    if (!process.env.AZURE_OPENAI_KEY)\n      throw new Error(\"No Azure API key was set.\");\n\n    this.className = \"AzureOpenAiEmbedder\";\n    this.apiVersion = \"2024-12-01-preview\";\n    const openai = new AzureOpenAI({\n      apiKey: process.env.AZURE_OPENAI_KEY,\n      endpoint: process.env.AZURE_OPENAI_ENDPOINT,\n      apiVersion: this.apiVersion,\n    });\n\n    // We cannot assume the model fallback since the model is based on the deployment name\n    // and not the model name - so this will throw on embedding if the model is not defined.\n    this.model = process.env.EMBEDDING_MODEL_PREF;\n    this.openai = openai;\n\n    // Limit of how many strings we can process in a single pass to stay with resource or network limits\n    // https://learn.microsoft.com/en-us/azure/ai-services/openai/faq#i-am-trying-to-use-embeddings-and-received-the-error--invalidrequesterror--too-many-inputs--the-max-number-of-inputs-is-1---how-do-i-fix-this-:~:text=consisting%20of%20up%20to%2016%20inputs%20per%20API%20request","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/EmbeddingEngines/azureOpenAi/index.js#L1-L25","documentation":"Thrown in the AzureOpenAiEmbedder constructor when process.env.AZURE_OPENAI_ENDPOINT is falsy, before the AzureOpenAI client is built. The endpoint is the Azure resource URL (e.g. https://<resource>.cognitiveservices.azure.com/), distinct from the key and the deployment name.","triggerScenarios":"Constructing the Azure OpenAI embedder while AZURE_OPENAI_ENDPOINT is unset/empty; pointing it at the wrong base URL; selecting the Azure embedding engine in config before provisioning the resource.","commonSituations":"Confusing AZURE_OPENAI_ENDPOINT with AZURE_OPENAI_KEY or with the deployment name; copying only the key from the Azure portal; using the generic OpenAI endpoint instead of the Azure resource endpoint; env var not propagated to the worker.","solutions":["Set AZURE_OPENAI_ENDPOINT to your Azure OpenAI resource endpoint (https://<resource-name>.cognitiveservices.azure.com/).","Also set AZURE_OPENAI_KEY (checked next) and EMBEDDING_MODEL_PREF to the deployment name.","Restart the process after editing .env so the var loads.","Confirm the endpoint is the Azure resource URL, not api.openai.com."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function assertAzureEmbedEnv() {\n  if (!process.env.AZURE_OPENAI_ENDPOINT) {\n    throw new Error('Missing env AZURE_OPENAI_ENDPOINT (Azure OpenAI resource URL)');\n  }\n}\nassertAzureEmbedEnv();","typeGuard":"/** @param {string} url */\nfunction isAzureEndpoint(url) {\n  return /^https:\\/\\/[a-z0-9-]+\\.cognitiveservices\\.azure\\.com\\/?/i.test(url || '');\n}","tryCatchPattern":"try {\n  new AzureOpenAiEmbedder();\n} catch (e) {\n  if (/endpoint/i.test(e.message)) { /* prompt for AZURE_OPENAI_ENDPOINT */ }\n  throw e;\n}","preventionTips":["Use the Azure resource endpoint URL, not api.openai.com.","Set endpoint, key, and EMBEDDING_MODEL_PREF together as a group.","Restart the process after setting the var."],"tags":["azure","openai","embeddings","config","env","startup"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}