Skip to content

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Jul 29, 2025

Description

This commit introduces a new Azure Redis Enterprise resource, enhancing the existing Redis functionality. Key changes include:

  • Introduced new Bicep modules for defining Azure Redis infrastructure.
  • Implemented extension methods in AzureRedisEnterpriseExtensions.cs for resource management.
  • Defined the Azure Redis Enterprise resource structure in AzureRedisEnterpriseResource.cs.

Fix #6831

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?

@github-actions github-actions bot added the area-integrations Issues pertaining to Aspire Integrations packages label Jul 29, 2025
This commit introduces a new Azure Redis Enterprise resource, enhancing the existing Redis functionality. Key changes include:

- Introduced new Bicep modules for defining Azure Redis infrastructure.
- Implemented extension methods in `AzureRedisEnterpriseExtensions.cs` for resource management.
- Defined the Azure Redis Enterprise resource structure in `AzureRedisEnterpriseResource.cs`.

Fix dotnet#6831
@eerhardt eerhardt force-pushed the AddRedisEnterprise branch from 1a82dc3 to d8f5be3 Compare August 25, 2025 19:15
Add tests
Revert Redis playground app
@eerhardt eerhardt marked this pull request as ready for review August 25, 2025 21:10
@Copilot Copilot AI review requested due to automatic review settings August 25, 2025 21:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds support for Azure Redis Enterprise, providing an enterprise-grade alternative to the existing Azure Redis functionality. The implementation enables both Azure-hosted and container-based development scenarios with proper authentication and role assignment support.

Key changes include:

  • New Azure Redis Enterprise resource type with Bicep template generation
  • Extension methods for adding Redis Enterprise resources to the application model
  • Container fallback support for local development
  • Role assignment configuration for Azure identity-based access

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Aspire.Hosting.Azure.Redis/AzureRedisEnterpriseResource.cs Core resource implementation with connection string, hostname, and password handling
src/Aspire.Hosting.Azure.Redis/AzureRedisEnterpriseExtensions.cs Extension methods for adding Redis Enterprise resources and container fallback
tests/Aspire.Hosting.Azure.Tests/AzureRedisEnterpriseExtensionsTests.cs Comprehensive test coverage for the new functionality
playground/ files Updated playground examples demonstrating Redis Enterprise usage
Multiple snapshot files Generated Bicep templates and test verification files

@eerhardt eerhardt requested a review from sebastienros August 25, 2025 21:25
@davidfowl
Copy link
Member

davidfowl commented Aug 28, 2025

Where's the equivalent of WithAccessKeyAuthentication?

@eerhardt
Copy link
Member Author

Where's the equivalent of WithAccessKeyAuthentication?

I'm wondering whether we need it or not. We don't support password/key auth for normal Azure resources, including SQL Server.

The original 3 database ones (Redis, CosmosDB, and PostgreSQL) had access key / password because that's all we knew how to do at the time. It took us a few versions to figure out how to support Entra auth.

So I think we leave WithAccessKeyAuthentication off until it is proven we need it.

@davidfowl
Copy link
Member

Redis and Postgres are special because they can work with compute that does not support azure natively (e.g keycloak). Sometimes client libs are updated to handle native azure RBAC but the ones that don't require username and password (or keys).

@davidfowl davidfowl closed this Sep 2, 2025
@davidfowl davidfowl reopened this Sep 2, 2025
Copy link
Contributor

github-actions bot commented Sep 2, 2025

🚀 Dogfood this PR with:

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 10726

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 10726"

@dotnet-policy-service dotnet-policy-service bot added this to the 9.5 milestone Sep 2, 2025
1. Make Azure Redis Enterprise experimental for its initial release
2. Support WithAccessKeyAuthentication
@eerhardt
Copy link
Member Author

eerhardt commented Sep 2, 2025

Ok, I've responded to all existing feedback. Please take another look.

@davidfowl
Copy link
Member

Tested and it works! (with key auth because I couldn't figure out azure redis rbac, #11141).

azd does not yet understand redis enterprise resources:

image

cc @vhvb1989

{
infrastructure.Add(new ProvisioningOutput("connectionString", typeof(string))
{
Value = BicepFunction.Interpolate($"{redis.HostName}:10000,ssl=true")
Copy link
Member

Choose a reason for hiding this comment

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

10000 is the port number? Why?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was the suggestion from @CawaMS and team. And it is the value when I create one through the portal.

Copy link
Member

Choose a reason for hiding this comment

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

Weird 😄

Copy link
Member

@davidfowl davidfowl left a comment

Choose a reason for hiding this comment

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

Few questions but 👍🏾

@eerhardt
Copy link
Member Author

eerhardt commented Sep 3, 2025

(with key auth because I couldn't figure out azure redis rbac, #11141).

See https://learn.microsoft.com/en-us/dotnet/aspire/caching/azure-cache-for-redis-integration?tabs=dotnet-cli#add-azure-cache-for-redis-authenticated-client for instructions how to do it until we have a client integration for it.

azd does not yet understand redis enterprise resources:

Looks like https://github.com/Azure/azure-dev/blob/a9a799fcecb24305bdf57298453574e3b0ac9622/cli/azd/pkg/azapi/azure_resource_types.go#L54-L96 needs to be updated.

@vhvb1989
Copy link

vhvb1989 commented Sep 3, 2025

Tested and it works! (with key auth because I couldn't figure out azure redis rbac, #11141).

azd does not yet understand redis enterprise resources:

image cc @vhvb1989

See: #11244 - I created a PR for you.

@davidfowl davidfowl merged commit 2237f18 into dotnet:main Sep 3, 2025
299 checks passed
@davidfowl
Copy link
Member

now assign copilot 😄

@vhvb1989
Copy link

vhvb1989 commented Sep 3, 2025

now assign copilot 😄

I did, but locally (VSCode + GHCP). I've been liking that one better than iterating in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-integrations Issues pertaining to Aspire Integrations packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Azure Redis enterprise
3 participants