Skip to content

feat: support entraid for azure managed redis - #39397

Open
wylswz wants to merge 11 commits into
langgenius:mainfrom
wylswz:feat/redis-azure-managed-identity
Open

feat: support entraid for azure managed redis#39397
wylswz wants to merge 11 commits into
langgenius:mainfrom
wylswz:feat/redis-azure-managed-identity

Conversation

@wylswz

@wylswz wylswz commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Added EntraID support for azure managed redis.

Resolves ESQ1-183

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@wylswz
wylswz requested a review from a team July 22, 2026 05:27
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 54.74% 54.72% -0.02%
Strict coverage 54.24% 54.22% -0.02%
Typed symbols 35,310 35,316 +6
Untyped symbols 29,466 29,493 +27
Modules 3051 3053 +2

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Azure Managed Redis authentication via Azure Managed Identity (Entra ID) to the backend Redis and Celery integrations, wiring in redis-entraid and a new config flag to enable credential-provider based auth.

Changes:

  • Introduces extensions.azure helpers (credential provider + Celery broker URL rewriting) and adds unit tests.
  • Adds REDIS_USE_AZURE_MANAGED_IDENTITY config/env flag and integrates it into Redis client creation and Celery configuration.
  • Adds the redis-entraid dependency (and lockfile updates).

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docker/.env.example Adds REDIS_USE_AZURE_MANAGED_IDENTITY env toggle example.
api/pyproject.toml Adds redis-entraid dependency pin.
api/uv.lock Locks redis-entraid and its transitive dependencies.
api/extensions/ext_redis.py Enables Redis credential provider auth when managed identity is enabled.
api/extensions/ext_celery.py Applies Entra ID auth to Celery broker and sets Redis backend credential provider.
api/extensions/azure.py New Azure/Entra ID credential provider wrapper and Celery broker URL helper.
api/configs/middleware/cache/redis_config.py Adds REDIS_USE_AZURE_MANAGED_IDENTITY setting to Redis config.
api/tests/unit_tests/extensions/test_azure.py New unit tests covering Azure Redis URL and credential-provider helpers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/extensions/azure.py
Comment thread api/extensions/ext_redis.py Outdated
@wylswz
wylswz force-pushed the feat/redis-azure-managed-identity branch from 7235594 to 8dd62b6 Compare July 22, 2026 07:20
@wylswz
wylswz marked this pull request as draft July 22, 2026 07:41
@wylswz
wylswz marked this pull request as ready for review July 22, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants