{"record":{"id":"e691e628dbac0290","repo":"BerriAI/litellm","slug":"azure-identity-is-required-for-azure-ad-redis-auth","errorCode":null,"errorMessage":"azure-identity is required for Azure AD Redis authentication. Install it with: pip install azure-identity","messagePattern":"azure-identity is required for Azure AD Redis authentication\\. Install it with: pip install azure-identity","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"litellm/_redis.py","lineNumber":224,"sourceCode":"def _build_azure_credential(\n    azure_client_id: str | None = None,\n    azure_tenant_id: str | None = None,\n    azure_client_secret: str | None = None,\n):\n    \"\"\"\n    Build a long-lived Azure credential object.\n\n    Azure SDK credentials cache tokens internally and handle expiry/refresh\n    transparently, so this should be called once and the result reused.\n    \"\"\"\n    try:\n        from azure.identity import (\n            ClientSecretCredential,\n            DefaultAzureCredential,\n            ManagedIdentityCredential,\n        )\n    except ImportError:\n        raise ImportError(\n            \"azure-identity is required for Azure AD Redis authentication. Install it with: pip install azure-identity\"\n        )\n\n    _client_id: Final = azure_client_id or os.environ.get(\"AZURE_CLIENT_ID\")\n    _tenant_id: Final = azure_tenant_id or os.environ.get(\"AZURE_TENANT_ID\")\n    _client_secret: Final = azure_client_secret or os.environ.get(\"AZURE_CLIENT_SECRET\")\n\n    if _client_id and _tenant_id and _client_secret:\n        return ClientSecretCredential(\n            client_id=_client_id,\n            tenant_id=_tenant_id,\n            client_secret=_client_secret,\n        )\n    elif _client_id:\n        return ManagedIdentityCredential(client_id=_client_id)\n    else:\n        return DefaultAzureCredential()\n","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/_redis.py#L206-L242","documentation":"Error \"azure-identity is required for Azure AD Redis authentication. Install it with: pip install azure-identity\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/_redis.py:224 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install azure-identity: pip install azure-identity, then retry the Redis connection."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}