dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.64k stars 25.28k forks source link

Add sample code for IDistributedCache #29618

Closed Rick-Anderson closed 1 year ago

Rick-Anderson commented 1 year ago

Provide samples for Azure Redis. Put the sample in https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/performance/caching/distributed/samples

put in 8.x/RedisCache folder


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 117610

fiyazbinhasan commented 1 year ago

@Rick-Anderson @tdykstra Does this sample require any additional configuration other than the following?

builder.Services.AddStackExchangeRedisCache(options =>
{
    options.Configuration = builder.Configuration.GetConnectionString("MyAzureRedisConStr");
    options.InstanceName = "SampleInstance";
});
"MyAzureRedisConStr": "<cache name>.redis.cache.windows.net,abortConnect=false,ssl=true,allowAdmin=true,password=<primary-access-key>"