{"record":{"id":"a39193082e864a06","repo":"BerriAI/litellm","slug":"azureexception-authenticationerror-message","errorCode":null,"errorMessage":"AzureException AuthenticationError - {message}","messagePattern":"AzureException AuthenticationError - (.+?)","errorType":"exception","errorClass":"AuthenticationError","httpStatus":401,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":1988,"sourceCode":"    elif \"Connection error\" in error_str:\n        raise APIConnectionError(\n            message=f\"{exception_provider} APIConnectionError - {message}\",\n            llm_provider=custom_llm_provider,\n            model=model,\n            litellm_debug_info=extra_information,\n        )\n    elif hasattr(original_exception, \"status_code\"):\n        if original_exception.status_code == 400:\n            raise BadRequestError(\n                message=f\"AzureException - {message}\",\n                llm_provider=\"azure\",\n                model=model,\n                litellm_debug_info=extra_information,\n                response=getattr(original_exception, \"response\", None),\n                body=getattr(original_exception, \"body\", None),\n            )\n        elif original_exception.status_code == 401:\n            raise AuthenticationError(\n                message=f\"AzureException AuthenticationError - {message}\",\n                llm_provider=\"azure\",\n                model=model,\n                litellm_debug_info=extra_information,\n                response=getattr(original_exception, \"response\", None),\n            )\n        elif original_exception.status_code == 404:\n            raise NotFoundError(\n                message=f\"AzureException NotFoundError - {message}\",\n                llm_provider=\"azure\",\n                model=model,\n                litellm_debug_info=extra_information,\n                response=getattr(original_exception, \"response\", None),\n            )\n        elif original_exception.status_code == 408:\n            raise Timeout(\n                message=f\"AzureException Timeout - {message}\",\n                model=model,","sourceCodeStart":1970,"sourceCodeEnd":2006,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/exception_mapping_utils.py#L1970-L2006","documentation":"Azure-specific status mapping: an upstream Azure OpenAI exception with HTTP 401 is re-raised as AuthenticationError with the 'AzureException' prefix, indicating rejected or missing credentials.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:1988 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify AZURE_API_KEY (or Azure AD credentials) are valid and not expired.","Ensure the key matches the Azure OpenAI resource in api_base."],"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-23T08:17:48.524Z"}