1

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

Tiago Somda
  • 144
  • 1
  • 5

1 Answers1

2

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();

Reference : https://github.com/Azure/AppConfiguration/blob/master/examples/DotNetCore/AzureFunction/FunctionApp/Startup.cs

You can obtain the instance of IFeatureManagerSnapshot & use it as part of your Azure Functions call.

Reference: https://github.com/Azure/AppConfiguration/blob/master/examples/DotNetCore/AzureFunction/FunctionApp/Startup.cs

Other references :

  1. Usage of Azure App Configuration's Feature Flags in Azure Functions
  2. https://github.com/MicrosoftDocs/azure-docs/issues/52234
Satya V
  • 3,811
  • 1
  • 6
  • 9