-
Notifications
You must be signed in to change notification settings - Fork 750
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
Document Process for Debugging Local Bot on Channels #1393
Comments
EAP Testing Instructions (Node Only)PrerequisitesEAP Testing assumes you have a bot deployed to Azure configured to use the Teams channel. TL;DR
PORT=3979;
NODE_ENV=development;
MICROSOFT_APP_ID=<your app id>;
MICROSOFT_APP_PASSWORD=<your bot's password>;
EMULATOR_URL=http://localhost:9000;
Run Your Bot in a Channel While Debugging LocallyIf you have configured your bot to run in 1 or more channels and would like to test a locally running bot using the Emulator while interacting with it in a communication app (Teams, Skype, Slack, WebChat, etc.), these instructions will show you how. Since chat messages, adaptive cards, and other features have notable differences across the many available channels, the Emulator cannot reasonably account for all of them. This guide shows you how to have a locally running bot where changes can be made quickly, breakpoints can be set and the project can be rebuilt and restarted while interacting with it via an installed app like Teams or Slack. How it worksThe tunneling software ngrok is used to create a tunnel to your locally running bot. The tunnel's URL is provided to your web app bot in Azure. You build your bot with an Emulator aware Adapter, run it locally then chat with it in Teams or any other available channel. The Emulator still receives the conversation's message exchange as usual. Let's get StartedIf you haven't already, get the latest Emulator, ngrok and update your bot's dependencies to use BotBuilder v4.4+ 1. Update Your Bot's CodeYour bot will need to become "Emulator Aware" in order to connect to and send the conversation exchange to the Emulator. Include the BotDebugger class somewhere in your bot's code: Then set the export EMULATOR_URL=http://localhost:9000 Alternatively, you can refer to documentation in VS Code for setting up environment variables in the launch configs for your bot. 2. Run ngrokOpen a terminal and run ngrok with the following command to create a new tunnel: ./ngrok http 3979 --host-header=localhost The output in the terminal should look something like this: 3. Update Azure to Point to the TunnelIn the azure portal, navigate to your bot's settings and paste the 4. Connect to a ChannelIf you haven't already done so, connect your bot to a channel. You may also need to download and install the app 5. Debug!Run your bot locally, then open the Emulator. In the Emulator choose file > Sidecar Debug Mode. This will place the Emulator in a read only mode an enable inbound connections from your locally running bot. Begin chatting with your bot in Teams, Skype, Slack or WebChat. Once the first message is received, your bot will connect to the Emulator and send it the conversation exchange. |
Document exact steps needed to connect a locally running bot to the Emulator while interacting with it using an external app or channel like Teams, Skype, Slack, etc.
The text was updated successfully, but these errors were encountered: