{"record":{"id":"f59679ff852e14ff","repo":"BerriAI/litellm","slug":"required-azure-api-key-in-environment-to-make-pa","errorCode":null,"errorMessage":"Required 'AZURE_API_KEY' in environment to make pass-through calls to Azure.","messagePattern":"Required 'AZURE_API_KEY' 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":1434,"sourceCode":"                    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\n\nfrom abc import ABC, abstractmethod\n\n\nclass BaseVertexAIPassThroughHandler(ABC):\n    @staticmethod\n    @abstractmethod","sourceCodeStart":1416,"sourceCodeEnd":1452,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py#L1416-L1452","documentation":"Guard at the fallback path of the Azure pass-through: no credential supplied an API key, so the proxy falls back to the AZURE_API_KEY environment variable, which is unset — leaving no auth credential to sign the upstream request.","triggerScenarios":"Thrown at litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py:1434 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set AZURE_API_KEY in the proxy environment.","Alternatively store the key on the Azure model entry via the UI (Models + Endpoints → LLM Credentials)."],"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-14T00:17:10.932Z"}