Hi Doumbia
Thank you for reaching out to Microsoft Q&A forum
As far as I know, the root cause of this behavior is Search‑based message extensions are synchronous: when a user types or submits a query, Teams sends an composeExtension/query invoke and expects HTTP 200 within five seconds; if you miss that SLA, the client drops the request and shows “Unable to reach app.” This deadline is not configurable. Timeouts typically occur when the backend experiences cold‑start latency or network/TLS overhead (common on serverless plans), or when the extension spends too long building/returning results. These conditions explain why your direct tests succeed (no strict client SLA and a warmed host) while Teams queries sometimes fail.Link reference: Respond to search command
Therefore, to mitigate this behavior, you can consider trying below methods:
1) Response‑first pattern (meet the 5‑second SLA).
Always return a valid composeExtension response within ~5 seconds, the external API call with a ~4‑second safety timer. If it completes, send real results, otherwise return a lightweight default and offer an Action to continue in a dialog (task module) for long operations. This avoids “Unable to reach app” while still supporting multi‑step work.
References:
2) Eliminate cold starts and startup jitter in Azure Functions.
You can consider hosting the Node.js backend on Azure Functions Premium or Flex Consumption, enable Always‑Ready and Prewarmed instances, and add a warmup trigger to preload dependencies so the language worker is hot before Teams invokes your bot and co‑locate the Function App and any external API in the same Azure region and reuse HTTP clients with keep‑alive to avoid per‑request TLS handshakes.
References:
Azure Functions hosting options
Best practices for reliable Azure Functions
Understanding serverless cold start
Hope my answer will help you, for any further concern, kindly let me know in the comment section.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.