Dynamic Functions settings

Jona 925 Reputation points
2023-11-27T22:11:23.18+00:00

Hi everyone

Let's suppose an app functions's code as follows:

dynamic function

This functions is listening to some event hub inside a event hubs namespace (as you know, a namespace can host several event hubs).

The configuration of the function requires the event hub name. So, my question is ¿can this name be dymamic?

Let's suppose I have 10 event hubs. All this message, not matter the event hub it belongs to, will be proccessed by the same source code. Eventually, I would have to deploy 10 functions changing the event hub name ...

This sounds well (a little weird for me, however), since every function will scale to adapt to the streaming flows of its corresponding event hub ...

¿Can I have just one functions listening to several event hubs dinamically? Like having a Env file to change the event hub name parameter.

Is this a good architectural approach?? the function will scale to adapt to all the event hubs?

Regards

Jonathan

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 25,241 Reputation points Microsoft Employee Moderator
    2023-11-29T06:39:03.8833333+00:00

    @Jona Thanks for your response. Apologize for the confusion here.

    I understand your concern but with one function app you can configure one event hub only. there is no way to call event hub dynamically with event hub trigger.

    Thats were you I have suggested to use either Http trigger or timer trigger to call different event hub.

    In case if any of the function trigger doesn't fill your requirement then you can use container apps or webapps and leverage the event hub SDK to read/listens the events continuously and pass the event hub names dynamically.

    Feel free to reach back to me if you have any further question on this.

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.