0

I use azure http functions written on java to handle different events based on webhooks.

Many of the configurations of these functions are stored in an azure app configuration, so we can dynamically change the configurations without restarting the function app. As a handler for the event I have an event grid triggered function which takes the new configurations from the app configuration only if a configuration modification event arrives ( Getting the configuration directly after every execution of the HTTP function is expensive ). This workflow works fine but the problem arrives, when we scale out the function app. Once there are more instances of the function app only one instance gets the event and changes the local configurations, all the other instances keep working with the old configurations.

Is there a way to make the scale controller distribute the event to all instances?

If a cache of the configurations is the best option, which azure resource would you take to make it less expensive?

Thanks in advance!

Tried sending more than one event on configuration change to the function app, but we have no guarantee that these events are equally distributed between the instances

1 Answers1

0

For the push model (via Event Grid), you will have to use something like Service Bus, as discussed in the doc below, to distribute the event to all instances of your Azure Functions.

https://learn.microsoft.com/en-us/azure/azure-app-configuration/enable-dynamic-configuration-dotnet-core-push-refresh

You can also consider the poll model. The App Configuration provider library does caching and refreshing for you automatically. It won't send one request to App Configuration per your function call. Please check out the doc below.

https://learn.microsoft.com/en-us/azure/azure-app-configuration/enable-dynamic-configuration-azure-functions-csharp

Zhenlan Wang
  • 1,213
  • 8
  • 10