问题
I created a quite simple bot, using the version 1.1.0 of Bot Builder, and it worked fine, both locally and after publishing on Azure. However, when I changed to the version 3 (and changed the respective code), my bot is working locally, but it is not working (on Bot emulator) after I have published it on azure. I don't know if I am using the Emulator in a wrong way, or if I am publishing it wrongly.
I changed the BotId, MicrosoftAppId and MicrosoftAppPassword tags of the webconfig.
When I use the button "Test connection to your bot" on Azure page, it responds "Accepted".
On the emulator, I am using the Bot Url as "https://XXXXXX.azurewebsites.net/api/messages", the Emulator URL as "http://localhost:9000/" and the respective AppId and AppPassword. The version of the emulator is 3.0.0.59
When I try to iniciate a conversation, I receive the 500 InternalError {"An error has occurred"}
Any ideias of what is wrong?
Thanks
回答1:
The messages are being routed to the Emulator URL http://localhost:9000 that's why this is not working. You need to forward the messages to a known location out on the web when trying to interact with your bot in the cloud using the emulator. For that purpose, you can use ngrok.
This topic in the documentation explain how to do it. Basically you need to run ngrok in this way:
ngrok http -host-header=rewrite 9000
And then update the emulator to use the https ngrok forwarding URL in the Emulator URL textbox.
来源:https://stackoverflow.com/questions/40239091/error-while-using-bot-framework-emulator-after-publishing-a-bot-v3-on-azure