AzureRedisExtensions.WithAccessKeyAuthentication 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.
Configures the resource to use access key authentication for Azure Cache for Redis.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureRedisCacheResource> WithAccessKeyAuthentication (this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureRedisCacheResource> builder);
static member WithAccessKeyAuthentication : Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureRedisCacheResource> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureRedisCacheResource>
<Extension()>
Public Function WithAccessKeyAuthentication (builder As IResourceBuilder(Of AzureRedisCacheResource)) As IResourceBuilder(Of AzureRedisCacheResource)
Parameters
- builder
- IResourceBuilder<AzureRedisCacheResource>
The Azure Cache for Redis resource builder.
Returns
A reference to the IResourceBuilder<T> builder.
Examples
The following example creates an Azure Cache for Redis resource that uses access key authentication.
var builder = DistributedApplication.CreateBuilder(args);
var cache = builder.AddAzureRedis("cache")
.WithAccessKeyAuthentication();
builder.AddProject<Projects.ProductService>()
.WithReference(cache);
builder.Build().Run();