AzureRedisEnterpriseExtensions.AddAzureRedisEnterprise Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds an Azure Managed Redis resource to the application model.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureRedisEnterpriseResource> AddAzureRedisEnterprise(this Aspire.Hosting.IDistributedApplicationBuilder builder, string name);
static member AddAzureRedisEnterprise : Aspire.Hosting.IDistributedApplicationBuilder * string -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureRedisEnterpriseResource>
<Extension()>
Public Function AddAzureRedisEnterprise (builder As IDistributedApplicationBuilder, name As String) As IResourceBuilder(Of AzureRedisEnterpriseResource)
Parameters
- builder
- IDistributedApplicationBuilder
The builder for the distributed application.
- name
- String
The name of the resource.
Returns
A reference to the IResourceBuilder<T> builder.
Remarks
By default, the Azure Managed Redis resource is configured to use Microsoft Entra ID (Azure Active Directory) for authentication. This requires changes to the application code to use an azure credential to authenticate with the resource. See https://github.com/Azure/Microsoft.Azure.StackExchangeRedis for more information.
var builder = DistributedApplication.CreateBuilder(args);
var cache = builder.AddAzureRedisEnterprise("cache");
builder.AddProject<Projects.ProductService>()
.WithReference(cache);
builder.Build().Run();