Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft ChatBot on AWS Cloud #693

Closed
shivabasayya opened this issue Jul 14, 2016 · 15 comments
Closed

Microsoft ChatBot on AWS Cloud #693

shivabasayya opened this issue Jul 14, 2016 · 15 comments

Comments

@shivabasayya
Copy link

Hi Friends,

Can any one help me by sharing your knowledge on MS Chatbot.
Can the bot be deployed on AWS cloud(EC2 machine) and connect through emulator installed in local machine for interation.?

If so, can you please share how we can do so,
We were able to setup NPM and NodeJS on AWS ec2 machine and write a small app.js to test HelloWorld bot app, but not able to connect from the emulator installed in local machine.

Your help would be great.

@dandriscoll
Copy link
Member

I don't know much about EC2, but this is definitely possible. The Bot Framework works with bots deployed on any cloud hosting service, as long as you have an internet-accessible endpoint and a valid HTTPS cert.

@thingista
Copy link

I just want to confirm that yes, it works with EC2 instances. Our bots are deployed on EC2.

@shivabasayya I am not sure about the emulator thing though (I don't use it). But once you are deployed, you can use the MS Bot Connector to test directly with Skype, Slack etc. The emulator is not really needed.

@shivabasayya
Copy link
Author

Thanks a lot for quick response, let me try with Bot Connector to test and will update.
Thanks

@garypretty
Copy link
Contributor

Hi @shivabasayya. You can use the emulator to connect to your bot remotely once deployed into EC2 (or wherever you choose to host it). The only difference between testing it locally and remotely is;

  • Your app Id and password need to be populated in the emulator
  • Your bot URL should be changed in the emulator to the remote endpoint Url

You also need to change the emulator Url. When you put a remote endpoint in you will find that the emulator will populate the 'Emulator Url' property with https://missing.ngrok.io/ because that Url needs to be a publically accessible Url to your emulator, on port 9000 by default. As the tooltip in the emulator says an easy way to do this is to download ngrok and call the following command;

ngrok http -host-header=rewrite 9000

If that runs successfully then you should get an ngrok.io Url, like https://256708e.ngrok.io to use as the Emulator Url, which will tunnel your traffic right to your emulator.

Once the above settings are in place you should be able to call your bot using your local emulator.

Hope that helps and let me know how it goes.

@shivabasayya
Copy link
Author

@garypretty : That was really helpful my fnd. thanks alot.
I was able to deploy my bot on EC2 machine and run tunnel to get public url and mentioned on the local emulator to test it, and worked perfectly. took a bit time with trial and error, but it was happy ending :) Thanks to you.

Also wanted to know about registering a bot on microsoft site, how its going to help me?
Is it only that when I register a bot, I will get iframeURL, that can be used in my html(when dont want to use emulator). Or any other use?

Correct me if my question is so bad :P

Thanks anyway, have a great day.

@jorenl
Copy link
Contributor

jorenl commented Jul 21, 2016

@shivabasayya Registering a bot on botframework.com gives you access to the Bot Connector service, through which you can set up channels (including Skype, Facebook Messenger, GroupMe, Kick, Telegram, ...) through which users can communicate with your bot. The webchat (which you can indeed embed as an iframe) is just one of the channels. Since bots created with the Bot Builder are typically stateless, the Bot Connector service also acts as a state API (this is where user data is stored in between messages) The emulator which you are running locally actually emulates ("pretends to be") this bot connector service, with its state API, and is just intended for development.

@shivabasayya
Copy link
Author

Thanks Jorenl: thanks for the clarification.

We came across another challenge I am sure I need your help there again.
We are using Luis as Engine and when we send request from our bot, the response from pre-built model (Cortana) is not consistent.

I am sure its issue with Luis and not the Bot requests.
Do you have any idea why it is so? we get error like 500 internal Error most of the time, in fact we
tried hitting the request directly on Luis site and found that there is no response.

We guessed, This can be due to

  • We are using Luis which is tired of serving millions of other requests.
  • We were using the pre-built model (Cortana).

If you could please help me on this it would be great.

I got a suggestion saying, trying deploying your bot on Azure and test, where they claim that luis connectivity & service from azure is much better than other places like local/AWS cluster(an EC2 machine).

Is that true?

Thanks again,

@shivabasayya
Copy link
Author

Hi Guys,

I wanted to know, how can i serve the images as responses to request from a end-user?
I am using emulator for chat window and was able to generate proper text msgs with the help of LUIS, and reply back to user.
Now I am trying to reply user with some pre-loaded images, that are stored locally or even at URLs, so that user can get an image as a response for his text Qn.

Your help would be great.

I am using nodeJS to programe my bot, so looking something in the same nodeJS instead of .net.

@ghost
Copy link

ghost commented Aug 3, 2016

@jorenl it looks like it doesn't matter where the bot is hosted (Azure, EC2, Lambda) when registering on botframework.com? I'm hoping to use the channels feature.

@danmarshall
Copy link
Contributor

Hi @shivabasayya - glad your original issue was solved. I am going to close this issue but feel free to open a new issue that is more specific.

@Praburaj-Krishnan
Copy link

Praburaj-Krishnan commented Feb 1, 2017

I need to deploy my bot in Amazon Web Services instead of Azure along with luis service. Is there any possibility to do? How to get subscription key for luis without using Azure?

@dandriscoll
Copy link
Member

Hi @Prabu-raj, yes, you can deploy your bot to AWS.

LUIS is a web service and is not something you deploy on your own. You can use LUIS from any platform, including AWS.

@cgarethc
Copy link

I'm replying to this thread because it's the closest to what I've been tearing my hair out over the last couple of days. I have a Node.JS bot hosted on AWS EC2, with a valid Comodo SSL certificate that works in Chrome/Firefox/Safari and I've configured a bot on the bot framework for my endpoint.

When I launch the bot framework console at https://dev.botframework.com I can click the "test" button and it says "Accepted". I can also send a message in the embedded web chat, and the logging on my bot on AWS shows the message being received, and a message being sent back with a call to session.send()... but the return message never appears back in the web chat. There are no errors logged on the server side or in the bot framework error viewer, the message just seems to be silently dropped. I added a Skype channel and get exactly the same behaviour in Skype.

When I deploy the same code to an Azure Web App it all works fine in both directions.

I'm totally stuck... I can't figure out what could be preventing the return message coming back, and I can't see what steps to take next for troubleshooting. It's not clear from the docs how a message is sent back to the framework, is there a particular host/IP/port I should be probing from EC2 to see if something is in the way? There are no outbound rules in my AWS security group that would prevent a connection, e.g. "telnet directline.botframework.com 80" succeeds.

Help?

@dandriscoll
Copy link
Member

Hi @cgarethc, the call back to the channel services is an HTTPS POST sent to the URL identified by the "ServiceUrl" property of the activity your bot is replying to. It is accompanied by a JWT token whose characteristics (and instructions for generating one) are described here: https://docs.botframework.com/en-us/restapi/authentication/

If you're seeing the call back to the ServiceUrl, and that call is succeeding, then something is wrong either in the message or in our service.

I can help debug Web Chat pretty easily -- can you send a Conversation ID for a case where you observed the error?

Opening a new issue may be worthwhile, as we're a ways away from the original question about platform support.

@Godrules500
Copy link

I am running into issues when accessing conversationState on a lambda. Does anyone have an example that I could look at?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants