Hi @Somya Mishra ,
Azure functions general last step is returning the response, the most reliable way is using 2 functions inside one function app, that is Logic app is calling first function and it gets a response and then it can continue the next process, then the 1st function app calls the 2nd one which actually transfers the file or the operation you want to do(You can also use a Queue function and http triggered function combination too).
Alternatively, you can also use Azure Durable Functions
Sample function which responds first and also completes the pending functions:
import time
import azure.functions as func
import azure.durable_functions as df
myApp = df.DFApp(http_auth_level=func.AuthLevel.ANONYMOUS)
@myApp.route(route="orchestrators/{functionName}")
@myApp.durable_client_input(client_name="client")
async def http_start(req: func.HttpRequest, client):
function_name = req.route_params.get('functionName')
instance_id = await client.start_new(function_name)
response = client.create_check_status_response(req, instance_id)
return response
# Orchestrator
@myApp.orchestration_trigger(context_name="context")
def sftp_orchestrator(context):
result1 = yield context.call_activity("hello", "Rithwik")
result2 = yield context.call_activity("hello", "Bojja")
result3 = yield context.call_activity("hello", "Chotu")
return [result1, result2, result3]
@myApp.activity_trigger(input_name="city")
def hello(city: str):
time.sleep(30)
return f"Hello {city}"
Here, it initially returns the orchestrator url and all as a response, but you will get orchestrator response after 1 min 30 sections as sleep is 30 sec and it is called 3 times. To just make it wait. In your function you can transfer file in this time or more time.
Here, I have used Python, you can use other languages too.
This is how you can get the desired results.
For further you can refer to [Ms-Doc] on Durable functions.
If this answer was helpful, please click "Accept the answer" and mark Yes
, as this can help other community members.
If you have any other questions or are still experiencing issues, feel free to ask in the "comments" section, and I'd be happy to help.