Thank you @PRADEEPCHEEKATLA-MSFT for the help to solve this issue.
The solution to avoid blocking the logic app in the call of the HTTP Webhook is to enable asynchronous request-response behavior.
In this case instead to use HTTP Webhook, I used simple HTTP service like the following illustration and every thing works well as wanted :
Azure Logic app is blocked after calling HTTP Webhook
Hello, I am trying to create the following workflow:
This flow it will be lunched each month. The logic app will use an HTTP Webhook to call an Orchestrator Azure function. This Orchestrator Azure function will call a two other Azure function.
I am using the Azure Orchestrator function because the two other azure functions take a lot of time to be executed, and in this case we are speaking about durable functions because otherwise if the logic app doesn't receive a response after some time(after some retries also) it will end with error. So the orchestrator will solve this issue by sending 202 response and make the logic app waiting until the azure functions ends they work (https://learn.microsoft.com/en-us/azure/azure-functions/durable/quickstart-python-vscode). The following picture shows I am calling the Orchestrator:
After receiving a 200 status from the HTTP Webhook which indicates that the azure functions finish working with success, it will go to the next step where we call an Azure pipeline , and then we will send an email about the status of the devops pipeline(if it ends with success or failed).
So this is the description of what I am doing.
My Problem is that the Logic app is blocked in the call of the HTTP Webhook. I already checked the azure functions and they works well, and I have already check there outputs by checking the logs and they end with success.
I don't know the problem comes from where exactly.
This is the code of the azure Orchestrator Function Starter:
import azure.functions as func
import azure.durable_functions as df
async def main(req: func.HttpRequest, starter: str) -> func.HttpResponse:
client = df.DurableOrchestrationClient(starter)
instance_id = await client.start_new(req.route_params["functionName"], None, None)
logging.info(f"Started orchestration with ID = '{instance_id}'.")
return client.create_check_status_response(req, instance_id)
This s the code of Orchestrator that calls the Azure functions
:
import azure.functions as func
import azure.durable_functions as df
def orchestrator_function(context: df.DurableOrchestrationContext):
result1 = yield context.call_activity('data-collection', None)
result2 = yield context.call_activity('data-merging', None)
return [result1, result2]
main = df.Orchestrator.create(orchestrator_function)
I have already tried to manipulate the params of the HTTP Webhook (Timeout duration and number of retries and the number of retries) but always the same problem.
Can any one have any proposition that can help to solve the issue ? thank you in advance guys
-
ElAbed Houssem I-DT 96 Reputation points
2021-10-19T13:50:30.937+00:00
1 additional answer
Sort by: Most helpful
-
Pramod Valavala 20,591 Reputation points Microsoft Employee
2021-10-12T16:28:40.077+00:00 @ElAbed Houssem I-DT The HTTP Webhook action requires the
callbackUrl
to be called to continue. So, you could pass it to the orchestration and call it at the end, similar to how you are calling the other APIs.Or you could just use the HTTP action instead which polls when it receives a 202 response by enabling asynchronous request-response behavior.