Bot Not Receiving Action.Submit Responses from Adaptive Card in Microsoft Teams Error 1008

Mario DeSousa 0 Reputation points
2024-11-12T10:12:34.06+00:00

Description:

Our bot has been set up to listen for incoming messages in TeamsBot.ts, we have tried to use two separate functions, handleTeamsMessagingExtensionSubmitAction and onInvokeActivity, to capture and handle messages. These functions were added to test which would properly capture messages coming from an adaptive card posted in a Teams channel. Ultimately, the bot is expected to post a message back if the setup works.

The Azure setup includes:

  1. An Azure Function, InvoiceNotification, that sends an adaptive card to the specified Teams channel as the bot using the BOT ID and Secret. The Adaptive Card is sent to the Specific Channel within Teams where the Bot has been added.
  2. Bot User ID has been verified in Teams, and Dev Tools shows HTTP requests confirming Teams’ attempt to send messages back to the bot at the URL: with the same ID.

Current Issue: The bot successfully sends the adaptive card to the specified channel, as the bot. However, when the "Update Invoice" button (Action.Submit) is clicked on the adaptive card, the bot encounters a 502 Bad Gateway in the console logs and with the below response in the network log.User's image

1-2-1 chat with the bot works fine, but when trying to send a message with our Azure Function to send the adaptive Card, the Action.Submit is failing.

We use an Azure Function to send the adaptive card because we have a Logic App running in the background that processes documents and extracts data. If certain required data cannot be extracted automatically, the Logic App sends this information to a Teams channel, requesting user input. Within the workflow, an adaptive card layout is generated and sent to the channel for user action. While the adaptive card displays correctly in Teams, we encounter an issue when users click the Action.Submit button on the card: instead of processing the request, it returns a 502 Bad Gateway error.

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,422 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.