I am following the steps listed here to refresh the App Config values when any config value is changed. However is there a way to refresh the services such as HTTPClient that are injected similar to the below where baseUrl is fetched from app config -
builder.Services.AddHttpClient("GitHub", httpClient =>
{
httpClient.BaseAddress = new Uri(appConfig.BaseUrl!);
// using Microsoft.Net.Http.Headers;
// The GitHub API requires two headers.
httpClient.DefaultRequestHeaders.Add(
HeaderNames.Accept, "application/vnd.github.v3+json");
httpClient.DefaultRequestHeaders.Add(
HeaderNames.UserAgent, "HttpRequestsSample");
});
Yes you can do this by registering a callback on configuration refresh like this.