Skip to content

Instantly share code, notes, and snippets.

@little-einstien
Created July 13, 2021 07:59
Show Gist options
  • Save little-einstien/bbbf344dc0f960963b10216c9412353e to your computer and use it in GitHub Desktop.
Save little-einstien/bbbf344dc0f960963b10216c9412353e to your computer and use it in GitHub Desktop.
// source https://jsbin.com
<h4>Create a bot</h4><p>This assignment shows you how to build a bot by using the Bot Framework SDK, and then shows how to test it with the Bot Framework Emulator.</p><h4>Prerequisites</h4><ul><li>ASP.NET Core Runtime 3.1</li><li>Bot Framework Emulator</li><li>Knowledge of ASP.NET Core and asynchronous programming in C#</li></ul><h4>Templates</h4><ul><ul><li>Visual Studio 2019 or later</li><li>Bot Framework v4 SDK Templates for Visual Studio</li></ul></ul><p>To add the bot templates to Visual Studio, download and install the <a href="https://marketplace.visualstudio.com/items?itemName=BotBuilder.botbuilderv4">Bot Framework v4 SDK Templates for Visual Studio</a> VSIX file.</p><h4>Create Bot</h4><p>In Visual Studio, create a new bot project using the Echo Bot (Bot Framework v4 - .NET Core 3.1) template. Choose AI Bots from the project types to show only bot templates.</p><p><img src="https://docs.microsoft.com/en-us/azure/bot-service/media/azure-bot-quickstarts/bot-builder-dotnet-project-vs2019.png?view=azure-bot-service-4.0" height="400px;" /></p><h4>Start your bot</h4><p>In Visual Studio</p><ul><li>Open your bot project.</li><li>Run the project without debugging.</li></ul><p>This will build the application, deploy it to localhost, and launch the web browser to display the application's default.htm page. At this point, your bot is running locally on port 3978.</p><h4>Start the Emulator and connect your bot</h4><ol><li>Start the Bot Framework Emulator.</li><li>Select Open Bot on the Emulator's Welcome tab.</li><li>Enter your bot's URL, which is the URL of the local port, with <code>/api/messages</code> added to the path, typically <code>http://localhost:3978/api/messages</code><p><img src="https://docs.microsoft.com/en-us/azure/bot-service/media/quickstart/emulator-open-bot.png?view=azure-bot-service-4.0" /></p></li><li><p>Then select <strong>Connect</strong>.</p><p>Send a message to your bot, and the bot will respond back.</p><p><img src="https://docs.microsoft.com/en-us/azure/bot-service/media/quickstart/emulator-hello-echo.png?view=azure-bot-service-4.0" /></p></li></ol>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment