May I have 2 functions with different triggers (Event Grid & Service Bus) in one project (repository) ?

Voynova, Silvena 20 Reputation points
2024-06-07T15:41:23.0033333+00:00

Hello,

I have two functions which are using identical Python code for different purposes. They both should reside in one Function App.

The first function is Event Grid triggered, with Event Subscription in IoT Hub and is using 'Microsoft.Devices.DeviceCreated' event type.

The second should be Service Bus Queue triggered, as Event Grid cannot catch events on Device Twin Update...

I want to have both functions in one repository (and in one Function App) and in one deployment pipeline after that.

Is this doable or not?

Note: The only issue we had with the first function is the deployment - not able to deploy correctly every time from the VS Code extension.

Thank you!

Silvena

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
574 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,526 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
338 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sander van de Velde | MVP 30,711 Reputation points MVP
    2024-06-10T06:39:38.5066667+00:00

    Hello @Voynova, Silvena,

    welcome to this moderated Azure community forum.

    Yes, you can have multiple Azure Function being executed within the same Web App.

    These functions with share the resources but that is ok.

    Only when you want to split your Azure Solution in multiple VNETs it's probably recommended to split the ingest (The IoT Hub logic) with the processing stuff (output of ADT).

    Here is a GitHub example with multiple functions for processing Azure Digital Twins logic.

    See how multiple functions are put in multiple files although this could have been one big file technically (but that is not practical).


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.


0 additional answers

Sort by: Most helpful