redis-entraid
Entra ID credentials provider implementation for Redis-py client
What it is and what it does
redis-entraid is a credential provider for redis-py that handles authentication to Azure's Redis services using Microsoft Entra ID. Instead of managing static passwords or connection strings, it integrates with Azure's identity services to fetch and refresh authentication tokens automatically. The package supports three authentication patterns: system-assigned managed identities (for Azure services), user-assigned managed identities (for cross-resource scenarios), and service principals (for application-to-service authentication).
The package wraps redis-py and sits between your application and the Redis client, managing token lifecycle in the background. It requires Python 3.10 or later and depends on redis, PyJWT, msal, azure-identity, and requests. You create a credential provider using one of three factory methods, optionally configure token refresh behavior, and pass it to the Redis client constructor. The package handles token expiration and renewal transparently, though you can also fetch credentials explicitly for testing or monitoring.
Use it for:
- Authenticate to Azure Managed Redis using a system-assigned or user-assigned managed identity without hardcoding credentials.
- Connect application service principals to Azure Cache for Redis with automatic token renewal in the background.
- Use Default Azure Credential to let the SDK automatically select the right authentication method based on the deployment environment.
- Replace static Redis passwords with Entra ID-based access control for compliance and security auditing in Azure-hosted applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Entra ID (Azure Active Directory) authentication for redis-py clients connecting to Azure Managed Redis and Azure Cache for Redis services.
Yes, if you are running Python 3.10+ and connecting to Azure Redis services. The package eliminates password management overhead and integrates cleanly with Azure's identity ecosystem. No known vulnerabilities, active maintenance, and low install friction. The only gotcha is that Entra ID authentication must be enabled on your Azure Redis instance and your identity must be granted access—this is an Azure configuration requirement, not a package limitation.
Install
redis-entraid on PyPI
pip
pip install redis-entraiduv
uv add redis-entraidpoetry
poetry add redis-entraidInstalling redis-entraid
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance status with recent releases. Depends on five runtime packages including redis, msal, and azure-identity, all standard Azure SDK components.
Quickstart
pip install redis-entraid
from redis import Redis
from redis_entraid.cred_provider import create_from_service_principal
credential_provider = create_from_service_principal(
CLIENT_ID, CLIENT_SECRET, TENANT_ID
)
client = Redis(host=HOST, port=PORT, ssl=True, credential_provider=credential_provider)
print(client.dbsize())
Requires Python 3.10 or later. Azure Redis instance must have Entra ID authentication enabled and the service principal or managed identity must be granted access to the cache resource.
Verify before relying
- Whether token renewal happens transparently during long-lived connections or requires explicit refresh calls
- Performance impact of background token management on connection pool behavior
- Compatibility with redis-py cluster or sentinel modes beyond standard connections
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — redis, PyJWT, msal, azure-identity, requests |
| Maintenance | actively maintained — 72 days since the last release |
| First released | |
| Downloads | 998,939/month — #4,542 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: redis_entraid-1.2.1-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
identityProvides a high-level authentication and…
permissive · top 15,000 on PyPI
flask-redisIntegrates Redis into Flask applications as a…
unclear · top 15,000 on PyPI
walrusWalrus extends the redis-py client with…
unclear · top 15,000 on PyPI
redisliteRedislite embeds a self-contained Redis server…
permissive · top 15,000 on PyPI
fastapi-azure-authAdds Azure Entra ID (formerly Azure AD)…
permissive · top 15,000 on PyPI
azure-identity-brokerExtends Azure Identity to enable authentication…
permissive · top 15,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
azure-mgmt-redisProvides Python bindings to manage Azure Redis…
permissive · top 5,000 on PyPI
django-redisProvides a Redis cache and session backend for…
permissive · top 5,000 on PyPI