How to get the return value from a durable function

Nijo Joseph Raju 141 Reputation points MVP
2020-06-30T17:46:57.11+00:00

Hello,

I am new to Azure functions and just tried out 2-3 azure function, while checking the best practices I came to know about Durable functions. I have tried out the sample code and its working. The thing which is not clear to me is "How can I access the return value". Following is my scenario I am calling a durable function from a mobile app as an http request, which should return data from another server as JSON, how does the requesting application gets the output?

Yes I understood, when I call the orchestrator client method, the response I get are another 4 APIs and I can get the orchestrator return value from "statusQueryGetUri" API. So is the mobile app supposed to call "orchestrator client" first and then get the data by calling "statusQueryGetUri"?

Sorry for the lame question

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,425 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pramod Valavala 20,596 Reputation points Microsoft Employee
    2020-07-01T07:13:23.807+00:00

    Yes. Your understanding is correct.

    The sample is an example for the Async HTTP APIs Pattern. This allows for long running operations without hitting the HTTP timeout limit. Your mobile app would have to poll the status update to check the progress of the operation.

    While this is the behavior when using the StartNewAsync API, you could alternatively use the WaitForCompletionOrCreateCheckStatusResponseAsync API which first waits for the output until the configured timeout. If the orchestration completes within the timeout, the result is returned and if not, the status response similar to the StartNewAsync API is returned.

    Also, a more advanced way to deal with this would be to use External Events or Event Grid Integration coupled with SignalR Service Binding.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful