Create a bot with the Azure Bot Service
The Azure Bot Service accelerates the process of developing a bot by provisioning a web host with one of five bot templates you can modify in 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 Go to resource on that notification.
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 Next to create the bot based on the programming language and template that you've chosen.
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, assure the app ID field is auto-populated for you, and 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.
Agree to terms, and click Create bot.
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.
Deploy changes to your web app bot
If you chose the App Service plan, follow these steps to modify your bot source and re-deploy your changes.
- In Azure, click your bot's BUILD tab, and click Open online code editor.
- Open the Dialogs folder, and click
- Change text in line 22 from
You just said.
- To deploy your changed source, click the Open Console icon.
- In the Console window, type build.cmd, and press the enter key.
The console window shows the deployment's progress until it's complete.
A bot on a Consumption plan automatically deploys each time you modify a source file in the online editor.
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 deployment. You can also configure your bot to run on one or more channels and publish your bot, without ever leaving the Azure portal.