TEAMS bot: Messages not received in messaging endpoint - bots

On one hand, I have a web application running and tunneled with ngrok:
https://87db45c5.ngrok.io -> http://localhost:3978
If i paste the https URL in a browser, I can see in ngrok cmd window:
GET / 304 Not Modified
to check when a request is received
On the other hand, I have created an App for my TEAMS client, using the App Studio (Manifest Editor - Create...)
I only need a BOT to send messages to my web application within a team. Messaging extensions is not used.
After App creation I have:
The bot (created from App Studio) available in dev.botframework.com/ (MyBots), with correct 'Messaging endpoint' and AppId (03a5d7c9-18cb-458e-9fd7-b3ec8ba6d67d). Microsoft Teams is added in Channel and is 'Running'.
My App registered in portal.azure.com, with the same AppId & AppSecret
My App/BOT available in the TEAMS team/chat (#bot)
I think I have all required parameters properly added, but when I send a message to my BOT in TEAMS ("#bot hello") I see no trace in the ngrok cmd window
In the past I had a bot running, but I had to restart the process from scratch.
Any idea about what I am missing?
Thanks in advance,
Diego

Related

How to connect a published bot to bot channel registration on Azure

I'm new to Azure. I had published a bot (developed locally) to Azure, e.g. named MyBot. It was shown as web service. Then I had created a bot channel registration on Azure e.g. named MyRegistration. As instructed, I wrote down the AppID and client secrete value from MyRegistration. In My Registration->settings, I put https://MyBot.azurewebsites.net/api/messages to the messaging endpoint. In MyBot->Configureation->Application settings, I added "MicrosoftAppId" and "MicrosoftAppPassword" and their values. I turned on "Web sockets" in MyBot->Configureation->General settings. I saved all the changes.
When I run "Test in Web Chat" in MyRegistration, nothing happened. In MyRegistration->Channels, there was "Issues" saying "There was an error sending this message to your bot: HTTP status code InternalServerError".
Can anybody help to point to what the reasons of failure were? Thank you very much.
Not sure the root reason, but I deployed my bot and go through this process but everything works perfectly for me. This is my steps below:
Deploy my bot service to Azure as a web app.
Create a Bot Channels registration, config my bot-message endpoint and Note Microsoft App ID:
Create a new secret, and note its value by clicking "Manage" Link:
Go to app service, and config App ID and App Password
Back to bot channel and have a web test. everything works as excepted:

Can't talk to QnAMaker bot in Azure or Teams, but can locally with emulator

I created a QnAMaker bot through the website https://www.qnamaker.ai, which then took me through the steps creating the bot in Azure.
When I click on the Test in Web Chat section of the bot in Azure, before I've even typed anything, an error message arrives in Channels > Web Chat > Issues that states: "There was an error sending this message to your bot: HTTP status code Unauthorized"
I have download the code of the bot locally, and running it with npm, using ngrok and the Bot Emulator, I have successfully managed to connect to the bot and it works.
I haven't touched the AppID or Password in the Bot's settings in Azure, and these are the same credentials I used for the local bot that works.
Could someone please help?
Thanks
I solved this by removing the bot entirely and creating a brand new one. I think the issue with some sort of mix up with the AppID and AppPassword, even though they were both correct in the settings

Bot works in Web Chat but not in Teams channel

I have created a sample Teams app with bot feature, cloning from https://github.com/OfficeDev/microsoft-teams-sample-complete-node/tree/master/src. It is running locally, using ngrok tunnel, and the bot is registered on Azure Bots Channel Registration.
The "Test in Web Chat" on Azure works fine, when I initiate the chat the bot sends a welcome message. When I type "hello" the bot responds with "Hello".
When I enable the Microsoft Teams channel, I click on the link on the channels page which brings me to a 1-to-1 conversation with the bot. The browser console already prints errors:
browser screenshot
When I type "hello" in the chat, the chat jumps to "Just me" channel. Bot only replies with welcome message, but not the expected "Hello": chat screenshot
The local ngrok shows conversationUpdate reaching the bot, which I suppose triggers the welcome message, but there is no text message reaching ngrok: ngrok sreenshot
The documentation Talk to your bot directly by Id suggests I should be able to search inside Teams using the subscription id, but the bot cannot be found. Does that indicate a problem with how Teams channel is configured?
I tried packaging it into an app and import into teams, following the instructions in above sample repository. The app has tabs pointing to the same local ngrok tunneled service, these load successfully. But when i type in the conversation tab, the message disappears right away. Neither a converationUpdate nor the text message reach ngrok.
This is a Teams caching issue. If your bot is deployed as a full 'Web App Bot', you're going to have to delete and redeploy it. If it's deployed as a Web App with a matching Bot Channels Registration, you can just delete the Bot Channels Registration and recreate it. It's now permanently tied to 'Just Me' and even if it's fixed, the conversation will never show up in it's own chat, and will remain in 'Just Me'.

No response from bot after publishing to Azure

I've built a bot locally on my PC, using the Microsoft Bot Builder v3.15.2.2 NuGet package.
Using the bot emulator v3.5.3.6 on my PC, I can connect to the bot and interact with it. After I published the bot to our Azure envirnoment, and using the Test in Web Chat option in the Bot Service page for my bot, I notice that the bot is not responding. I enter a message, press enter, but nothing comes back from the bot.
I have registered the bot using the https://apps.dev.microsoft.com/ website, and I copied the app ID and password from that site into the app settings of my bot web.config file. I can verify that those settings appear correct in the Application settings tab for my Azure Web App for the bot.
I've spent a long time looking at log streams, and diagnostic files via Kudu, but it's not clear to me why there is no response coming back from the bot. As another test, I edited the default.htm file of the project to include an iframe to host the bot chat window (the iframe code was obtained via the Channels tab on the bot service page). When I typed into the iframe, the same result occurs - I do not get a response from the bot.
Remote debugging with Visual Studio isn't really an option, as our company has strict security in place, and I doubt they will be willing to open ports for me to attach Visual Studio to the Azure Web App.
I'm at a standstill here, since I do not know what to do look for in diagnosing the issue. Any suggestion would be appreciated.
EDIT
I opened the DevTools and attempted to chat with the bot using the `Test in Web Chat tab in Azure. The following error was caught in the console window:
botchat.js:20 WebSocket connection to 'wss://webchat.botframework.com/v3/directline/conversations/<FOO>/stream?watermark=-&t=<FOO>' failed: Error during WebSocket handshake: Unexpected response code: 400
Note that I replaced token values with <Foo> for privacy. I hope this might be useful clue for someone.
Make sure your messaging endpoint is set to https://{botname}.azurewebsites.net/api/messages in the bot settings.
The problem was to do with our network proxy.
Basically, since testing the bot in Azure Portal uses websockets, our proxy by default blocks websocket access. So, boom, no response from the bot.
By changing our network settings for the bot config, we are no receiving responses from the bot.

New bot not answering messages in microsoft teams

I'm running a bot with Microsoft Teams and have it setup in Azure. It's a demo bot from the bot builder code Microsoft released. I'm pointing it to a local server that has ngrok running. This works fine when I test via Web Chat in Azure but it doesn't work at all when working with Teams.
The app sideloads properly and the manifest is accepted by teams. No response appears to be making it to the server. When I click to show the Bot Channels in Azure some kind of OPTIONS query is being sent to the server and the demo bot throws a 405 error.
The bot id is f22039b8-5400-4569-a0f2-5bdceb8431f2 but I can't talk to it in 1:1 chat either when I specify this ID.
There are no logs in Azure or teams- I don't see any errors, so I have no idea how to start debugging this.
This is a link to someone with the exact same question:
Bot not answering messages in microsoft teams
There is currently a bug in our bot registration code that is causing this. We are currently investigating its root cause.
As a workaround, add the Skype channel and the MS Teams channel to the bot.

Resources