Options for calls between functions in different Function Apps

Andrew Syrov 51 Reputation points
2021-07-01T01:04:43.207+00:00

Can anyone point to a reference for different options to call one function from another across different function apps?

All reference architectures that I see fall into the following categories:

  • #1 Client calls function by HTTP trigger and function returns the result (sort flat architecture with no calls between different function apps).
  • #2 HTTP trigger creates a durable function which then called some other functions using HTTP (and I guess does some writes to storage, while running).

Yet, if we have different function apps developed by different teams, deployed separately. How do we, in some efficient way call function in a different app (which also can call further app functions). I'm also looking for ways to reduce the number of writes to different storages (queues, etc) during this chain of calls.

The only way I see it, such a chain of calls may be done using HttpClient. Yet, this sounds like there should be a better way (such as azure itself should know how to do cross calls between different Function Apps).

Thanks!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,656 Reputation points Microsoft Employee Moderator
    2021-07-02T06:24:43.333+00:00

    @Andrew Syrov Using HTTP is probably the simplest way to go about this and is widely used for most microservice deployments. Usually, deployments leverage a service discovery component to route requests or use a single API Gateway for all services.

    In Azure, you can use Azure APIM to register all functions under the same endpoint. This allows you to send requests to the same endpoint irrespective of which function app they are in. Check this doc that talks about Gateway Aggregation.

    But there are scenarios where you could leverage other options like message queues. Use these, you can implement patterns like Choreography.

    Finally, Durable Functions are a great option too if you need to run long-running processes without dealing with the underlying queues.


Your answer

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