I am using azure app configuration with azure function. So i want to refresh the keys automatically but i am getting configurationRefresher as null always.
builder.AddAzureAppConfiguration(appConfigurationOptions =>
{
appConfigurationOptions
.Select(ConfigurationKeys.AZURE_FUNC_TEST)
.Select(KeyFilter.Any, environment.EnvironmentName)
.ConfigureRefresh(refreshOptions =>
{
refreshOptions.Register(ConfigurationKeys.AZURE_FUNC_TEST, true);
refreshOptions.SetCacheExpiration(TimeSpan.FromMinutes(1));
})
.UseFeatureFlags(flagOptions =>
{
flagOptions.Label = environment.EnvironmentName;
flagOptions.CacheExpirationInterval = TimeSpan.FromSeconds(30);
})
.GetRefresher();
configurationRefresher = appConfigurationOptions.GetRefresher();
},true);
return builder;
I found the reason why it is null actually i have the above code in a helper class and then i am passing the above result to the startup class and then in startup class it builds. Hence i am not getting value. But is there any way to get the value in startup class and above code i want it in helper class