Skip to content

Commit a89a783

Browse files
authored
Update tunneling software and instructions (#2469)
1 parent bc1cc05 commit a89a783

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

content/CHANNELS.md

+13-16
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
## TL;DR
1010
1. Update your Emulator to be on version `4.5`. You can do this by selecting `Help` -> `Check for Update...`
11-
1. Install [ngrok](https://ngrok.com/) and navigate to the ngrok executable's location in a terminal.
11+
1. Install [DevTunnels](https://aka.ms/devtunnels/)
1212
1. [Update your bot's code](#1-update-your-bots-code)
13-
1. Run ngrok `./ngrok http 3979 --host-header=localhost`
14-
1. Open your bot in the [Azure Portal](https://ms.portal.azure.com/), select the `Settings` blade and paste the ngrok url provided in the terminal into the *Messaging Endpoint* field then save. **note:** If necessary, don't forget to add the `/api/messages` endpoint.
15-
1. Set the appropriate environment variables (prefix with EXPORT for OSX/Linux, SET for Windows):
13+
1. Run DevTunnels `devtunnel host -a -p 3979`
14+
1. Open your bot in the [Azure Portal](https://portal.azure.com/), select the `Settings` blade and paste the devtunnel url provided in the terminal into the *Messaging Endpoint* field then save. **note:** If necessary, don't forget to add the `/api/messages` endpoint.
15+
1. Set the appropriate environment variables (prefix with `EXPORT` for OSX/Linux or `SET` for Windows):
1616

1717
```bash
1818
NODE_ENV=development;
@@ -32,10 +32,10 @@ If you have configured your bot to [run in 1 or more channels](https://docs.micr
3232
**Note:** Since chat messages, Adaptive Cards, and other features have notable differences across the many available channels, the Emulator cannot visually recreate all experiences at this time. Instead, the Emulator provides the inspection of [channel-specific](https://blog.botframework.com/2017/03/28/Custom-Channel-Data/) protocol data and [internal bot state](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-concept-state?view=azure-bot-service-4.0) as each turn context executes throughout the conversation within a channel.
3333

3434
## How it works
35-
The tunneling software [ngrok](https://ngrok.com/) 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 the BotBuilder **4.4** [InspectionMiddleware](https://github.com/Microsoft/botbuilder-js/blob/1c790f4a4f0d761c215eb3841ff370f4b274f5d1/libraries/testbot/index.js#L21), and run it locally, chatting with it in Teams or another configured channel. The Emulator will receive the conversation's message exchange as usual, and some internal bot state information now being exposed through this middleware.
35+
The tunneling software 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 the BotBuilder **4.4** [InspectionMiddleware](https://github.com/Microsoft/botbuilder-js/blob/1c790f4a4f0d761c215eb3841ff370f4b274f5d1/libraries/testbot/index.js#L21), and run it locally, chatting with it in Teams or another configured channel. The Emulator will receive the conversation's message exchange as usual, and some internal bot state information now being exposed through this middleware.
3636

3737
## Let's get Started
38-
If you haven't already, get the [latest Emulator](https://github.com/Microsoft/BotFramework-Emulator/releases), [ngrok](https://ngrok.com/) and update your bot's dependencies to use BotBuilder v4.4+
38+
If you haven't already, get the [latest Emulator](https://github.com/Microsoft/BotFramework-Emulator/releases), [Dev Tunnels](https://aka.ms/devtunnels) and update your bot's dependencies to use BotBuilder v4.4+
3939

4040
### 1. Update Your Bot's Code
4141
Your bot will need to configure the Bot Inspector middleware in order to connect to and send the conversation exchange to the Emulator. Include the [InspectionMiddleware](https://github.com/Microsoft/botbuilder-js/blob/1c790f4a4f0d761c215eb3841ff370f4b274f5d1/libraries/testbot/index.js#L21) in your Bot's middleware stack:
@@ -59,22 +59,19 @@ if (process.env.MicrosoftAppId && process.env.MicrosoftAppPassword) {
5959
adapter.use(new InspectionMiddleware(inspectionState, userState, conversationState, credentials, process.env.MicrosoftAppId, process.env.MicrosoftAppPassword))
6060
```
6161
62-
### 2. Run ngrok
63-
Open a terminal instance and run ngrok with the following command to create a new tunnel (you may need to navigate to where the ngrok executable lives on your filesystem) the port specified is the same port your bot is running on:
62+
### 2. Run Dev Tunnels
63+
Open a terminal instance and run Dev Tunnels with the following command to create a new tunnel the port specified is the same port your bot is running on:
64+
6465
65-
OSX
66-
```bash
67-
./ngrok http 3978 --host-header=localhost
68-
```
69-
Windows
7066
```bash
71-
"ngrok.exe" http 3978 --host-header=localhost
67+
devtunnel host -a -p 3978
7268
```
7369
74-
Save the https entry generated by ngrok to your clipboard.
70+
71+
Save the https entry generated by DevTunnels to your clipboard.
7572
7673
### 3. Update Azure to Point to the Tunnel
77-
In the azure portal, [navigate to your bot's settings](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-manage-settings?view=azure-bot-service-4.0) and paste the url provided by the ngrok terminal in the *Messaging endpoint* field and save the changes. Do not forget to use `/api/messages`. It's best to create a Bot in Azure that is used specifically for this purpose. Do not overwrite the messaging endpoint of a deployed production bot.
74+
In the azure portal, [navigate to your bot's settings](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-manage-settings?view=azure-bot-service-4.0) and paste the url provided by the devtunnel terminal in the *Messaging endpoint* field and save the changes. Do not forget to use `/api/messages`. It's best to create a Bot in Azure that is used specifically for this purpose. Do not overwrite the messaging endpoint of a deployed production bot.
7875
7976
### 4. Set the appropriate environment variables in your Bot's running process & start the Bot
8077
```bash

content/assets/ngrok.png

-280 KB
Binary file not shown.

0 commit comments

Comments
 (0)