{"record":{"id":"ff3427921d6c10bf","repo":"BerriAI/litellm","slug":"azureexception-message","errorCode":null,"errorMessage":"AzureException - {message}","messagePattern":"AzureException - (.+?)","errorType":"exception","errorClass":"BadRequestError","httpStatus":400,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":1979,"sourceCode":"        )\n    elif \"The api_key client option must be set either by passing api_key to the client or by setting\" in error_str:\n        raise AuthenticationError(\n            message=f\"{exception_provider} AuthenticationError - {message}\",\n            llm_provider=custom_llm_provider,\n            model=model,\n            litellm_debug_info=extra_information,\n            response=getattr(original_exception, \"response\", None),\n        )\n    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}\",","sourceCodeStart":1961,"sourceCodeEnd":1997,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/exception_mapping_utils.py#L1961-L1997","documentation":"Azure-specific catch-all for status-code 400 errors not matched by earlier string checks: re-raised as litellm BadRequestError with the Azure message preserved, meaning the request itself was rejected by the service.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:1979 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the Azure error message and fix the request or configuration accordingly.","Enable verbose logging for the full Azure response."],"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"}