I am looking to disable and enable a azure function using feature flags. Any idea?
Can we disable azure function using feature flag
266 Views Asked by Sap_vr At
2
There are 2 best solutions below
1
On
You should have a look at https://learn.microsoft.com/en-us/azure/azure-functions/disable-function?tabs=portal#c-class-libraries which has a decorator for turning on or off functions without allowing them to be triggered.
edit: Here's an answer for what is supported with attributes: https://github.com/Azure/azure-functions-dotnet-worker/issues/312
I believe we can do disabling and enabling the functions in an Azure Function Project using feature flags in the below process:
Microsoft.Extensions.Configuration.AzureAppConfiguration,Microsoft.FeatureManagementpackages.Feature Manager instance should be kept in DI Class by using the
FunctionsStartupclass.There is a boilerplate code given by Microsoft on using the feature flags in Azure Functions to change the functionality in runtime.