First you should inject IConfiguration and then for reading from appsettings, you can use one of this methods:
Get a section data
var redisConfig = configuration.GetSection("RedisConfig");
Get a value within a section
var redisServer = configuration.GetValue<string>("RedisConfig:ServerName");
Get nested value within section
var redisExpireMInutes = configuration.GetValue<int>("RedisConfig:ServerName:ExpireMInutes");