{"record":{"id":"38a014f26faaf0be","repo":"BerriAI/litellm","slug":"required-azure-api-base-in-environment-to-make-p","errorCode":null,"errorMessage":"Required 'AZURE_API_BASE' in environment to make pass-through calls to Azure.","messagePattern":"Required 'AZURE_API_BASE' in environment to make pass-through calls to Azure\\.","errorType":"exception","errorClass":"Exception","httpStatus":500,"severity":"error","filePath":"litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py","lineNumber":1427,"sourceCode":"                extra_headers = auth_credentials.get(\"headers\") or {}\n\n                base_target_url = litellm_params.get(\"api_base\")\n                if base_target_url is None:\n                    raise Exception(f\"API base not found for {part}\")\n                return await BaseOpenAIPassThroughHandler._base_openai_pass_through_handler(\n                    endpoint=endpoint,\n                    request=request,\n                    fastapi_response=fastapi_response,\n                    user_api_key_dict=user_api_key_dict,\n                    base_target_url=base_target_url,\n                    api_key=None,\n                    custom_llm_provider=litellm.LlmProviders.AZURE_AI,\n                    extra_headers=cast(dict, extra_headers),\n                )\n\n    base_target_url = get_secret_str(secret_name=\"AZURE_API_BASE\")\n    if base_target_url is None:\n        raise Exception(\"Required 'AZURE_API_BASE' in environment to make pass-through calls to Azure.\")\n    # Add or update query parameters\n    azure_api_key: Final = passthrough_endpoint_router.get_credentials(\n        custom_llm_provider=litellm.LlmProviders.AZURE.value,\n        region_name=None,\n    )\n    if azure_api_key is None:\n        raise Exception(\"Required 'AZURE_API_KEY' in environment to make pass-through calls to Azure.\")\n\n    return await BaseOpenAIPassThroughHandler._base_openai_pass_through_handler(\n        endpoint=endpoint,\n        request=request,\n        fastapi_response=fastapi_response,\n        user_api_key_dict=user_api_key_dict,\n        base_target_url=base_target_url,\n        api_key=azure_api_key,\n        custom_llm_provider=litellm.LlmProviders.AZURE,\n    )\n","sourceCodeStart":1409,"sourceCodeEnd":1445,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py#L1409-L1445","documentation":"Guard at the fallback path of the Azure pass-through: no per-deployment api_base was resolved, so the proxy falls back to the global AZURE_API_BASE environment variable, which is unset — leaving no target URL for the request.","triggerScenarios":"Thrown at litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py:1427 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set AZURE_API_BASE in the proxy environment to your Azure OpenAI endpoint URL.","Alternatively configure api_base on the Azure deployment in config.yaml."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}