public static string GetRequiredValue(this IConfiguration configuration, string key) => configuration[key] ?? throw new InvalidOperationException($"Configuration value for '{key}' is null");var value = configuration.GetRequiredValue("key");