The Azure Bot Service accelerates the process of developing a bot by providing an integrated environment that is purpose-built for bot development. This tutorial walks you through the process of creating and testing a bot by using the Azure Bot Service.
You must have a Microsoft Azure subscription before you can use the Azure Bot Service. If you do not already have a subscription, you can register for a free trial.
Create your bot
To create a bot by using the Azure Bot Service, sign in to Azure and complete the following steps.
Create a new bot service
Select New in the menu blade.
In the New blade, navigate to the Data + Analytics category, and select Bot Service.
In the Bot Service blade, provide the requested information, and click Create to create the bot service and deploy it to the cloud.
Confirm that the bot service has been deployed.
- Click Notifications (the bell icon that is located along the top edge of the Azure portal). The notification will change from Deployment started to Deployment succeeded.
- After the notification changes to Deployment succeeded, click that notification.
Create App ID and password
Next, create an app ID and password for your bot, so that it will be able to authenticate with the Bot Framework.
Click Create Microsoft App ID and password.
On the page that opens in a new browser tab, click Generate an app password to continue.
Copy and securely store the password that is shown, and then click Ok.
Click Finish and go back to Bot Framework.
Back in the Azure Portal, the app ID field is now auto-populated for you. Paste the password that you copied (in step 3 above) into the password field.
If the app ID field is not auto-populated, you can retrieve it by signing in to the Microsoft Application Registration Portal and copying the application ID from your application's registration settings.
Click Manage Microsoft App ID and password only if you want to generate a secondary password for your bot now. In the future, you can manage app ID and password at any time by using the Bot Framework Portal, as described here.
Select your programming language
Choose the programming language that you want to use to develop your bot.
Select a template and create the bot
Select the template to use as the starting point for developing your bot. For this tutorial, choose the Basic template.
Then, click Create bot to create the bot based upon the programming language and template that you've chosen.
When you click Create bot, there may be a slight delay before a splash screen renders to indicate that the bot service is generating your bot. Do not click Create bot again. Please wait for the splash screen to appear.
When the bot service finishes generating your bot, the Azure editor will contain the bot's source files. At this point, the bot has been created, registered with the Bot Framework, deployed to the cloud, and is fully functional. If you sign in to the Bot Framework Portal, you'll see that your bot is now listed under My bots. Congratulations! You've successfully created a bot by using the Azure Bot Service!
Test your bot
Now that your bot is running in the cloud, try it out by typing a few messages into the built-in chat control that's located to the right of the code editor in Azure. You should see that the bot responds to each message you send by echoing back your message prefixed with the text You said.
In this tutorial, you created a simple bot by using the Azure Bot Service and verified the bot's functionality by using the built-in chat control within Azure. At this point, you may want to add more functionality to your bot or set up continuous integration. You can also configure your bot to run on one or more channels and publish your bot, without ever leaving the Azure portal.