In this article I will demonstrate how to create a nodejs bot hosted in Azure. The bot will be created from a sample provided from Microsoft. The example bot will use Azure Functions as the trigger for it’s communication. You will need a Microsoft Azure account to be able to follow this process for yourself. This is only an introduction on how to get up and running, more steps in the process will come later.
Looking at the documentation on how to create a test a nodejs bot within the Microsoft Bot Framework can be found in the Microsoft documentation (What is Bot Builder for Node.js and why should I use it?).
I found another more interesting (less CLI) way to do it through Azure portal. As I work my way through figuring out how all this works I expect there will be a number of blog posts as there is a lot to talk about. This post is focused on getting us up and running.
As of February 2017 this Bot Service is in Preview and the process may change before it goes GA later in the year !
Creating a bot service in Azure
Within your Azure portal create a new instance of a bot service from within Intelligence and Analytics.
Give it a name and resource group
Once created you will be able to access your bot from your portal resources pane.
Setting up your service
Opening your new service for the first time, you’ll be presented with the form to create an AppId and secret password for your bot. Follow the prompts and get back to the screen to create a sample bot.
We are going to select NodeJS and create an azure function bot for the sake of demo
and then we wait……Ho hum, I wonder what’s going on in the background – probably magic….
Once the bot has been created you will be presented with a web based IDE showing you the node code and a chat window on the right.
You can talk to yourself!! Something I like to do all the time…..apparently….
Back in Azure Portal
In setting up all this up, Azure auto-magically created a number of new services have been created in the Azure Portal to manage this functionality(which is why we had to wait for the background magic earlier). We can now see the following services making all this happen.
How it works and how it is happening will come in future blog posts. For the moment we are up and running……and this blog post is getting long enough already.
This entire process took no more than about 15 minutes to complete. There is a lot more to explore around the deployment of the bot and the further development thereof, but for the moment we are up and running with a bot and Azure Functions (at least in development).
I now have a nagging feeling that this is cool and all, but I really should check and understand how much those new magic services are going to cost…….
4 thoughts on “How to create a sample nodejs bot which utilizes Azure Functions in 15 minutes”
[…] the previous article we looked at how to create your first sample Azure bot which uses Azure Functions in the background. This article will continue from where that left […]
[…] previous articles we have seen how to create a sample bot and how to link it into Skype. In this article we are going to look at how to use Visual Services […]
[…] the previous article we looked at how to create a sample azure bot and then how to configure it in VSTS for continuous […]
[…] previous articles we have looked at how to create a sample Azure bot and in this article we will be looking into how “intents” work. The microsoft […]