Search code examples
botframework

Why BotFramework Emulator needs ngrok to connect to bots hosted on Azure Web App Service


I am trying to use the BOT simulator to connect and test my Bot SDK application that I've deployed to Azure App Service.

When I run the bot web api propject locally, I can test it with the simulator no problem.

However, when I try to test the same application that is hosted remoely, the simulator fails. After investigation, I found that the simulator needs ngork to be able to connect to bot service that are hosted remotely

https://github.com/Microsoft/BotFramework-Emulator/wiki/Getting-Started#connecting-to-bots-hosted-remotely

If your bot is hosted remotely, ensure that ngrok tunneling software is installed and configured. The Bot Framework Emulator is tightly integrated with ngrok and can launch it for you when needed.

The matter has confused others and they asked questions here:

https://github.com/Microsoft/BotFramework-Emulator/wiki/Getting-Started#connect-to-a-bot-hosted-remotely

Why the simultor has dependance on ngork to connect to remotely hosted bots? It seem conter intuitive since the dns name is publicly available


Solution

  • When you're running the emulator locally and debugging in the cloud, you need to be set up for traffic to flow bi-directionally. By default without NGROK you can post to your bot, but for it to POST back to your client, it needs an IP address to post to. NGROK provides that without you having to set up local ports, etc.