Reputation: 144
I have been trying to use use feature flags with azure functions, but I can't seem to get the configuration correctly.
There is some documentation on how to get the configuration values, but nothing around feature management. https://learn.microsoft.com/en-us/azure/azure-app-configuration/use-feature-flags-dotnet-core
Upvotes: 1
Views: 725
Reputation: 4174
Yes, It is possible !
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
configurationBuilder.AddAzureAppConfiguration(options =>
{
options.Connect(Environment.GetEnvironmentVariable("ConnectionString"))
// Load all keys that start with `TestApp:`
.Select("TestApp:*")
// Configure to reload configuration if the registered 'Sentinel' key is modified
.ConfigureRefresh(refreshOptions =>
refreshOptions.Register("TestApp:Settings:Sentinel", refreshAll: true)
)
// Indicate to load feature flags
.UseFeatureFlags();
You can obtain the instance of IFeatureManagerSnapshot & use it as part of your Azure Functions call.
Other references :
Upvotes: 2