skillfed

redis-entraid

Entra ID credentials provider implementation for Redis-py client

redis-entraid v1.2.1 998.9K downloads/30d#4,542 on PyPI
License unclear Active released

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-entraid

uv

uv add redis-entraid

poetry

poetry add redis-entraid

Installing 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

azure redis authenticationentra id redis clientmanaged identity redisazure active directory redisservice principal redisredis-py azure integrationazure cache for redis auth
azure-integrationauthentication

More Database packages