0

I have tried to find out how I can notify multiple microservice (MS) instances via eventdriven approach if their Azure App Configuration values are changed. I have found that I via Eventgrid can listen on changes in Azure App Configuration but I don't find any built in method to distribute event to multiple instances (many MS instances)... I can choose webhook but then it will be to one instance, I can choose other eventdriven approaches as Event Hub but then I have to setup that and I wonder what is best practice for this? I don't want each MS to poll for changes rather to be notified and receive what has been changed or is there a better built in approach/strategy?

user3154653
  • 203
  • 1
  • 11

1 Answers1

2

For push-based configuration updates from Azure App Configuration, the suggested approach is to forward events to a Service Bus Topic. Azure Service Bus SDK provides RegisterMessageHandler method that allows clients to register a message handler that would be triggered for every message recieved in the topic. Each instance of the microservice could set up a subscription to this Service Bus Topic and register a message handler during service initialization to receive configuration updates.

The instructions to set up a service bus topic can be found here. Details on the protocols available to subscribe to service bus topics and the required firewall configuration can be found here. Since a single topic can support up to 2000 subscriptions, this approach would allow up to 2000 service instances.

Abhilash Arora
  • 277
  • 2
  • 4
  • Another question...For each MS-instance do I need to create a new unique subscriber programmaticly for given instance or is there a built in mechanism for one-to-many-messaging – user3154653 Jan 05 '21 at 17:37
  • Each microservice instance needs to create its own subscription programmatically. This is the supported way for multiple subscribers to consume messages from a service bus topic. – Abhilash Arora Jan 05 '21 at 21:31