{"record":{"id":"0a477ede58ed0f35","repo":"Graphify-Labs/graphify","slug":"azure-openai-backend-requires-azure-openai-endpoin-0a477e","errorCode":null,"errorMessage":"Azure OpenAI backend requires AZURE_OPENAI_ENDPOINT to be set.","messagePattern":"Azure OpenAI backend requires AZURE_OPENAI_ENDPOINT to be set\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"graphify/llm.py","lineNumber":2685,"sourceCode":"                read_timeout=_resolve_api_timeout(),\n                connect_timeout=10,\n                retries={\"max_attempts\": _resolve_max_retries() + 1, \"mode\": \"adaptive\"},\n            ),\n        )\n        resp = client.converse(\n            modelId=mdl,\n            messages=[{\"role\": \"user\", \"content\": [{\"text\": prompt}]}],\n            inferenceConfig=_bedrock_inference_config(max_tokens, mdl),\n        )\n        bu = resp.get(\"usage\") or {}\n        if bu:\n            _rec(bu.get(\"inputTokens\", 0), bu.get(\"outputTokens\", 0))\n        return _bedrock_response_text(resp, default=\"\")\n\n    if backend == \"azure\":\n        endpoint = os.environ.get(\"AZURE_OPENAI_ENDPOINT\", \"\").strip()\n        if not endpoint:\n            raise ValueError(\n                \"Azure OpenAI backend requires AZURE_OPENAI_ENDPOINT to be set.\"\n            )\n        azure_client = _azure_client(key, endpoint)\n        azure_kwargs: dict = {\n            \"model\": mdl,\n            \"messages\": [{\"role\": \"user\", \"content\": prompt}],\n            \"max_completion_tokens\": max_tokens,\n        }\n        azure_temp = _resolve_temperature(cfg.get(\"temperature\", 0), mdl)\n        if azure_temp is not None:\n            azure_kwargs[\"temperature\"] = azure_temp\n        resp = azure_client.chat.completions.create(**azure_kwargs)\n        if not resp.choices or resp.choices[0].message is None:\n            raise ValueError(\"Azure OpenAI returned empty or filtered response\")\n        au = getattr(resp, \"usage\", None)\n        if au is not None:\n            _rec(getattr(au, \"prompt_tokens\", 0), getattr(au, \"completion_tokens\", 0))\n        return resp.choices[0].message.content or \"\"","sourceCodeStart":2667,"sourceCodeEnd":2703,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/graphify/llm.py#L2667-L2703","documentation":"ValueError raised when backend='azure' is configured but the AZURE_OPENAI_ENDPOINT environment variable is empty/whitespace. graphify constructs the Azure client from this env var (stripped) plus the API key; without an endpoint there is nothing to call, so it fails fast before any request.","triggerScenarios":"Selecting backend 'azure' with AZURE_OPENAI_ENDPOINT unset or containing only whitespace (llm.py:2684-2687). The key comes from _azure_client(key, endpoint); the endpoint must be the Azure OpenAI resource endpoint (https://<resource>.openai.azure.com).","commonSituations":"Copy-pasting config from a colleague without the env var; .env file not loaded in CI; setting AZURE_OPENAI_API_KEY but forgetting the endpoint var; shell quoting mistakes that leave the var empty.","solutions":["Set the endpoint: export AZURE_OPENAI_ENDPOINT='https://<your-resource>.openai.azure.com' (find it on the Azure OpenAI resource Overview page).","If using a .env file, confirm it is actually loaded by the process that runs graphify (printenv AZURE_OPENAI_ENDPOINT to verify).","If you did not mean Azure, switch the backend to openai/claude/etc."],"exampleFix":"# before\nexport AZURE_OPENAI_API_KEY=...\n# AZURE_OPENAI_ENDPOINT missing\n$ graphify label --backend azure   # ValueError\n\n# after\nexport AZURE_OPENAI_ENDPOINT=\"https://my-resource.openai.azure.com\"  # your resource URL\n$ graphify label --backend azure","handlingStrategy":"validation","validationCode":"import os\nendpoint = os.environ.get(\"AZURE_OPENAI_ENDPOINT\", \"\").strip()\nif not endpoint:\n    raise SystemExit(\n        \"backend 'azure' requires AZURE_OPENAI_ENDPOINT\"\n        \" (https://<resource>.openai.azure.com)\"\n    )","typeGuard":null,"tryCatchPattern":"try:\n    result = call_llm(prompt, backend=\"azure\")\nexcept ValueError as exc:\n    if \"AZURE_OPENAI_ENDPOINT\" in str(exc):\n        raise SystemExit(\"Set AZURE_OPENAI_ENDPOINT to your Azure OpenAI resource URL\") from exc\n    raise","preventionTips":["Treat Azure as a three-part config: endpoint env var, key env var, deployed model name - check all three together.","Fail fast at startup on missing env config instead of discovering it mid-run.","Prefer a single sourced env file over scattered exports."],"tags":["azure","configuration","environment","llm"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}