Create a bot with the Bot Framework SDK
APPLIES TO: SDK v4
Creating your first bot doesn't require an Azure subscription or an Azure AI Bot Service resource. This quickstart focuses on creating your first bot locally. If you'd like to learn how to create a bot in Azure, see Create an Azure Bot resource.
Existing bots built with these SDKs will continue to function.
For more information, see The future of bot building.
The current bot samples use .NET Core 3.1 templates.
To add the bot templates to Visual Studio, download and install the Bot Framework v4 SDK Templates for Visual Studio VSIX file.
You can install the templates from within Visual Studio.
- In the menu, select Extensions then Manage Extensions.
- In the Manage Extensions dialog, search for and install Bot Framework v4 SDK templates for Visual Studio.
For information about deploying .NET bots to Azure, see how to Provision and publish a bot.
Create a bot
In Visual Studio, create a new bot project and use the Echo Bot (Bot Framework v4 - .NET Core 3.1) template. To see only bot templates, choose the AI Bots project type.
Thanks to the template, your project contains all the necessary code to create the bot in this quickstart. You don't need any more code to test your bot.
Start your bot
In Visual Studio:
- Open your bot project.
- Run the project without debugging.
- Visual Studio builds the application, deploys it to localhost, and launches the web browser to display the application's
At this point, your bot is running locally on port 3978.
Start the Emulator and connect your bot
Start the Bot Framework Emulator.
Select Open Bot on the Emulator's Welcome tab.
Enter your bot's URL, which is your local host and port, with
/api/messagesadded to the path. The address is usually:
Then select Connect.
Send a message to your bot, and the bot will respond back.