Forum Discussion
Azure Function Not Sending Response Back to Teams Bot – Integration Issue
Azure Function Called by Teams Bot – Triggered Successfully but No Response in Web Chat
We are integrating a Microsoft Teams Bot (C#) with an Azure Function (Python). While the Azure Function gets triggered successfully, we are not receiving any response back in Web Chat or Teams.
What We Have Done:
Teams Bot (C#) is running locally in Visual Studio.
We added code to call the Azure Function using HttpClient:
What We Have Done:
Bot Framework Bot (C#) is running locally via Visual Studio (on ports 7130/5130).
We’ve added this code to call the Azure Function:
var httpClient = new HttpClient();
var response = await httpClient.PostAsync(
"https://<function-url>/api/Foundarybasic",
new StringContent(JsonConvert.SerializeObject(turnContext.Activity), Encoding.UTF8, "application/json")
);
Azure Function (Python) is deployed and logs show that it receives the request and processes it correctly: ( I tested this from Power Automate getting Proper Response)
@app.route(route="Foundarybasic", auth_level=func.AuthLevel.ANONYMOUS)
def Foundarybasic(req: func.HttpRequest) -> func.HttpResponse:
logging.info("Function triggered")
data = req.get_json()
user_text = data.get("text", "No message")
reply = {
"type": "message",
"text": f"Echo: '{user_text}' — Azure Bot integration is working!"
}
return func.HttpResponse(json.dumps(reply), mimetype="application/json", status_code=200)
Problem:
Azure Function logs show it receives and processes the request correctly.
However, nothing shows up in Web Chat or Teams client.
No error messages or failed HTTP codes are observed.
We want the Teams Bot to call the Azure Function and relay its response back to the user, like an echo bot
Is there a required structure for the response that the Bot Framework expects from an external HTTP call?
Does the bot need to manually send the Azure Function's response back using turnContext.SendActivityAsync(...)?
Are there any known working patterns or best practices for calling Azure Functions from a Teams Bot?
Any help, samples, or suggestions would be greatly appreciated!
Thanks!
1 Reply
- Nivedipa-MSFT
Microsoft
@AllabashaShaik1990 - Thanks for bringing this issue to our attention.
The Bot Framework does NOT automatically relay HTTP responses from external services (like Azure Functions) to the user. You must explicitly send the Azure Function’s response back to the user using turnContext.SendActivityAsync(...) in your bot code.
Thanks,
Nivedipa-----------------------------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.