{"record":{"id":"2c63ec4de5fb2a53","repo":"BerriAI/litellm","slug":"failed-to-get-azure-ad-token-e","errorCode":null,"errorMessage":"Failed to get Azure AD token: {e}","messagePattern":"Failed to get Azure AD token: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure/common_utils.py","lineNumber":381,"sourceCode":"            azure_ad_token_provider = BaseAzureLLM._try_get_default_azure_credential_provider(\n                scope=scope,\n            )\n\n    # Execute the token provider to get the token if available\n    if azure_ad_token_provider and callable(azure_ad_token_provider):\n        try:\n            token: Final = azure_ad_token_provider()\n            if not isinstance(token, str):\n                verbose_logger.error(\"Azure AD token provider returned non-string value: %s\", type(token))\n                raise TypeError(f\"Azure AD token must be a string, got {type(token)}\")\n            else:\n                azure_ad_token = token\n        except TypeError:\n            # Re-raise TypeError directly\n            raise\n        except Exception as e:\n            verbose_logger.error(\"Error calling Azure AD token provider: %s\", e)\n            raise RuntimeError(f\"Failed to get Azure AD token: {e}\") from e\n\n    return azure_ad_token\n\n\nclass BaseAzureLLM(BaseOpenAILLM):\n    @staticmethod\n    def _try_get_default_azure_credential_provider(\n        scope: str,\n    ) -> Callable[[], str] | None:\n        \"\"\"\n        Try to get DefaultAzureCredential provider\n\n        Args:\n            scope: Azure scope for the token\n\n        Returns:\n            Token provider callable if DefaultAzureCredential is enabled and available, None otherwise\n        \"\"\"","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure/common_utils.py#L363-L399","documentation":"Error \"Failed to get Azure AD token: {e}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure/common_utils.py:381 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the inner exception '{e}'; verify AZURE_TENANT_ID/AZURE_CLIENT_ID/AZURE_CLIENT_SECRET and network access to login.microsoftonline.com."],"exampleFix":null,"handlingStrategy":null,"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"}