In this part we will test our live azure service on Microsoft Bot Emulator Channel.
Let first make sure our azure service is up and running.
Make sure azure live url (http://botapplication120160926104506.azurewebsites.net/api/messages) on browsing returns result similar to below screen shot.
Make sure live azure service returns success on bot page
Lets launch emulator and enter the below fields
Once you enter the above field and enter any message you will see something like below screen shot.
The reason for failing of message is that live azure could not connect back to Emulator url.
In order to make our bot url available to azure live url we need to work with NGROK.
you can download the ngork from the following url (https://ngrok.com/download)
Once downloaded the ngrok run the following command through command prompt
ngrok http -host-header=rewrite 9001
Once you run the command you will see the below output
The forwarding url is the url availble to outside world, which is mapped to our local port 9001
Copy that url and paste in Microsoft Emulator Url
Now you type the message you will see the output
Let first make sure our azure service is up and running.
Live Bot Url Testing
Make sure azure live url (http://botapplication120160926104506.azurewebsites.net/api/messages) on browsing returns result similar to below screen shot.
Make sure live azure service returns success on bot page
Connecting to Microsoft Bot Emulator Channel
Lets launch emulator and enter the below fields
- Bot Url
- Microsoft App Id
- Microsoft App Password
Once you enter the above field and enter any message you will see something like below screen shot.
The reason for failing of message is that live azure could not connect back to Emulator url.
In order to make our bot url available to azure live url we need to work with NGROK.
NGORK
Ngor is small utility which makes local port number available to outside world.you can download the ngork from the following url (https://ngrok.com/download)
Once downloaded the ngrok run the following command through command prompt
ngrok http -host-header=rewrite 9001
Once you run the command you will see the below output
The forwarding url is the url availble to outside world, which is mapped to our local port 9001
Copy that url and paste in Microsoft Emulator Url
Now you type the message you will see the output
Things to remember
- Bot url must have /api/messages appended
- Emulator url can have http or https
- Bot url can have http or https
Quite a great bot builder workflow explanation you have given here.Thanks for sharing this post with us.
ReplyDeleteHi @Rajesh,
ReplyDeleteThanks and glad to know it helped someone.