user3711357
user3711357

Reputation: 1635

Azure: Call one functionapp from another functionapp

have two function app (httptrigger) in one of azure function apps project.

PUT

DELETE

In certain condition, would like to call DELETE function app from PUT function app.

Is it possible to get directly RUN of DELETE function app as both are resides in same function app project ?

Upvotes: 0

Views: 396

Answers (2)

Pawel Maga
Pawel Maga

Reputation: 5807

There is a few ways to call a function from the function:

  1. HTTP request - it's simple, execute a normal HTTP request to your second function. It's not recommended, because it extends function execution time and generates a few additional problems, such as the possibility of receiving a timeout, the unavailability of the service and others.

  2. Storage queues - make communication through queues (recommended), e.g. the first function (in your situation: "PUT function) can insert a message to the queue and the second function ("DELETE function") can listen on this queue and process a message.

  3. Azure Durable Functions - this extensions allows to create rich, easy-to-understand workflows that are cheap and reliable. Another advantage is that they can retain their own internal state, which can be used for communication between functions.

Read more about cross function communication here.

Upvotes: 2

MarkXA
MarkXA

Reputation: 4394

I wouldn't recommend trying to call the actual function directly, but you can certainly refactor the DELETE functionality into a normal method and then call that from both the DELETE and PUT functions.

Upvotes: 1

Related Questions