How to set up Microsoft Bot SDK on live server with nodeJS - node.js

I've created a bot using the Microsoft Bot SDK, using some scaffolding code to create a bot that echoes your name. Doing gulp grok-serve the bot is hosted through ngrok and the messaging endpoint is at that temporary ngrok URL followed by /api/messages. Using this I've set up the bot to work with Microsoft Teams and I can successfully talk to the bot. I've now moved the code to be on a live server, however I'm not sure how to access the messaging endpoint through the live server. Using the server domain name followed by the name of the folder with the bot code in it, I get a 403 error. Following that with /api/messages gives a 404 error.

Related

Directline speech node js connection

Hi I'm trying to enable the direct line speech channel with my chatbot developed in node js. I have done the settings by following https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-directlinespeech?view=azure-bot-service-4.0 also webchat sample taken from https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/03.speech/a.direct-line-speech. I'm getting the html page with microphone and the speech is converted to text but when send that is not received in my app service endpoint. Can someone guide me what may be wrong in my implementation.
or sharing any documentations that can help me in implementing this will also be very helpful.
Requirements:
We need to get the workspace and the bot installed into the workspace.
Get the bot connected into the Direct Line speech channel
Get the app services running and enable public access
Get the web app and connect it to the application services.
Build the static web app (HTML page) deploy it into the GitHub repository or any kind of repository. For this thread. Considered GitHub.
Launch the application in the browser.
Get the token from the created bot and use them to connect with bot created.
Output:
The following is the output achieved in the browser.

Error sending this message to your bot: HTTP status code Forbidden. Azure portal and Getting Untrusted Domain issue in Web App bot service

Im getting below error(Img:1) in Web Chat channel after deploying the code, upto lastweek it is working fine but suddenly im getting the untrusted Origin error in browser console of Web App bot service and couldn't able to connect to the bot using "Test in Web Chat" feature. I have attached the Untrusted Origin error screen shot(Img:2) below. I am using .bot file as managing resource with Development and Production( Micorsoft AppId , App paswword, endpoint). I tried migrating .bot file to Appsettings(( Micorsoft AppId , App paswword, endpoint) as the managing resource but still getting the same error. Please help with the resolution for the error.
Img:1
Img:2
Here are the some of the resources need to check.
Kindly check the below points:
Check whether the messaging endpoint specified in settings in portal is correct or not. Please check with the path at the URL end (../api/messages)
Verify the bot configuration settings to check with whether using any incorrect APP ID and Password
The Messaging endpoint specified on the Settings page for your bot in the Bot Framework Portal does not begin with https or is not trusted by the Bot Framework. Your bot must have a valid, chain-trusted certificate.
Alternate Options:
Under 'TLS/SSL settings' --> set 'HTTPS Only' to 'On'.
For reference on similar issue kindly go through the below link:
There was an error sending this message to your bot - Test in Web Chat
I believe you have Enhanced Authentication enabled in the Directline channel and don't have the domain setup as a trusted origin.
https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-authentication?view=azure-bot-service-4.0#security-considerations

Bot Authentication failing with there was an error sending this message to your bot: HTTP status code Unauthorized

I just started working on Bot framework. I have created new bot application and deployed it on my local cluster. When i tested it from bot framework emulator only by using the localhost endpoint the bot is working as expected.
Now I have created a bot channel registration and connected it to Web Chat.
This gives me the app id and secret. Now when I enter this app id and secret into my appsettings.json and again try to hit the bot emulator, this time entering the App Id and Password it is throwing 401 authentication error. Any help what might be causing this issue ? Do I need to introduce any dependency in my code ? Can this be any problem of https vs http ?
Not sure how you are defining your AAD, but I will suggest you to check the following document, which guide how to add AAD to your bot correctly: https://learn.microsoft.com/en-us/previous-versions/azure/bot-service/bot-builder-tutorial-authentication?view=azure-bot-service-3.0&tabs=aadv1
Thanks.
On investigation it turned out to be that the IConfiguration was not loading appsettings.json file, hence app id and password weren't getting picked up by the adapter. Passing app id and password manually in the adapter fixed the issue.

HTTP status Unauthorized

I have problem with deployment, I have created functional bot that perfectly works till I don't insert Microsoft App Id & Microsoft App Password to my appsettings.json file. When I deploying Bot to Azure portal and trying to test Web Chat, I got a problem : HTTP status code Unauthorized. App Id and Password I got from created resource Bot Channel Registration , any suggestions what I'am doing not right? I'll be Thankfully for any answers.

My bot works fine in the emulator,even with Microsoft app id and password but when I'm testing it online it fails

My bot works fine in the emulator, even with Microsoft app id and password but when I'm testing it at https://dev.botframework.com I get a message
couldn't send message retry
I get a
401 unauthorized
error when I'm trying to get a reply from the emulator with bot url https://botwebdeployment.azurewebsites.net/ (deployed in azure).
I have added my bot bot in Microsoft bot directory and have enabled Skype, but even on my machine I can send message on Skype app to bot but I don't get any reply.
Verify application settings - confirm you've updated the Microsoft App ID & Password then deploy to Azure again.
Verify HTTPS endpoint - In the dev portal (https://dev.botframework.com), settings page; make sure you used HTTPS instead of HTTP.
Reference: https://learn.microsoft.com/en-us/bot-framework/deploy-bot-visual-studio

Resources