{"record":{"id":"2e29fd9514d00f03","repo":"BerriAI/litellm","slug":"azure-identity-is-required-for-azureadcredential","errorCode":null,"errorMessage":"azure-identity is required for AzureADCredential. Install it with: pip install azure-identity","messagePattern":"azure-identity is required for AzureADCredential\\. Install it with: pip install azure-identity","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"litellm/proxy_auth/credentials.py","lineNumber":105,"sourceCode":"        Get an access token from Azure AD.\n\n        Args:\n            scope: The OAuth2 scope (e.g., \"api://my-app/.default\")\n\n        Returns:\n            AccessToken with the JWT and expiration.\n\n        Raises:\n            ImportError: If azure-identity is not installed.\n        \"\"\"\n        if not self._initialized:\n            try:\n                from azure.identity import DefaultAzureCredential\n\n                self._credential = DefaultAzureCredential()\n                self._initialized = True\n            except ImportError:\n                raise ImportError(\n                    \"azure-identity is required for AzureADCredential. Install it with: pip install azure-identity\"\n                )\n\n        result: Final = self._credential.get_token(scope)\n        return AccessToken(token=result.token, expires_on=result.expires_on)\n\n\nclass GenericOAuth2Credential:\n    \"\"\"\n    Generic OAuth2 client credentials flow.\n\n    This works with any OAuth2 provider (Okta, Auth0, Keycloak, etc.)\n    that supports the client_credentials grant type.\n\n    Example:\n        cred = GenericOAuth2Credential(\n            client_id=\"my-client-id\",\n            client_secret=\"my-client-secret\",","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy_auth/credentials.py#L87-L123","documentation":"Missing-dependency error from AzureADCredential.get_access_token: the optional azure-identity package is not installed, so DefaultAzureCredential cannot be constructed to mint Azure AD tokens. Install azure-identity (or use a different credential type) to use Azure AD auth.","triggerScenarios":"Thrown at litellm/proxy_auth/credentials.py:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install azure-identity: pip install azure-identity."],"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"}