SlideShare a Scribd company logo
1 of 50
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating and Deploying
a Bot Service Using the
Bot Framework and
Visual Studio
Murray Fife
mufife@microsoft.com
June 2017
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
Creating a Bot Service
Linking the Bot Service to the Bot App
Publishing the Bot to Channels
Bots are great, and really easy to create with Visual
Studio and the Bot Framework. But if you want to
take your Bots to the next level then you really want
to set them free and deploy them to the cloud as a
Bot Service.
In this quick walkthrough we will show you how you
can do just that.
Creating and Deploying a Bot Service through Visual Studio 2017
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Step 1: Go to the Bot Framework site
Step 2: Click on Register a bot
Step 3: Set the Bot Name
Step 4: Add a Bot handle for the Bot
Step 5: Add a Description for the Bot
Step 6: Click on the Create Microsoft App ID and password
button
Step 7: Login using your Microsoft Account
Step 8: Click on the Generate an app password to continue
button
Step 9: Click on the Finish and go back to Bot Framework button
The first thing that we need to do is to register our Bot.
Creating and Deploying a Bot Service through Visual Studio 2017
Registering a Bot
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
We can register our Bots through the Bot Framework site.
So open up the Bot Framework website by browsing to
dev.botframework.com.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 1: Go to the Bot Framework site
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
Now that we are on the Bot Framework site we can start
registering a new Bot.
To do this, just click on the Register a bot link at the top of
the page.
This will open up the Bot Registration form where we can
start the setup of our Bot Service.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 2: Click on Register a bot
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
We will start off the registration process by giving our Bot a
name.
We do that by entering our Bots name into the Name field.
For this Bot we set the Name to VoightKampffBot.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 3: Set the Bot Name
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
Next we will want to give out Bot a Handle.
The Handle will be the name that is used by the Bot
whenever it is interacting with you.
To do this, just enter a value into the Bot handle field.
For this Bot we set the Bot handle to Voight-Kampff.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 4: Add a Bot handle for the Bot
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
If we want, we can also give our Bot a Description to give
people a general idea as to what our Bot does.
To do this, just enter in an overview of the Bot into the
Description field.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 5: Add a Description for the Bot
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
Now that we have entered in the profile information for the
Bot, we can move on to setting up the Configuration
details.
If we scroll down on the Bot creation page then we will see
that there are some more details within the Configuration
section that we need to specify.
The first one that we will want to fill in is the App ID, which
is the unique identifier for the Bot, which we need to create.
To create a new App ID, click on the Create Microsoft App
ID and password button.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 6: Click on the Create Microsoft App ID
and password button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
This will take us to a login page where we need to log in
with a Microsoft account.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 7: Login using your Microsoft Account
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
After we have logged in, we will be taken to a Generate
App ID and Password page.
The App name will be automatically populated from the
Bot registration form, and also a unique App ID will be
created for us, which we will want to note down.
All we need to do is to create an app password.
To do this, click on the Generate an app password to
continue button.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 8: Click on the Generate an app
password to continue button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
This will open up a dialog box with a new App password.
Note down the App password and then click on the OK
button to exit from the form.
Note: This will be the only time that you will be able to see
this password, so make sure you copy it down.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 8: Click on the Generate an app
password to continue button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Registering a Bot
Now that we have our App ID and our Password we can
return back to the Bot registration page and assign the App
ID to our Bot.
To do this, just click on the Finish and go back to Bot
Framework button.
When we return to the Bot registration form, we can then
paste our App Id into the App Id field in the form.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 9: Click on the Finish and go back to
Bot Framework button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Step 1: Open up Visual Studio
Step 2: Select the Bot Application template
Step 3: Change the Project Name
Step 4: Create the Bot Service project
Step 5: Open up the web.config
Step 6: Update the BotId key
Step 7: Update the AppId key
Step 8: Update the MicrosoftAppPassword key
Step 9: Open the MessageController.cs file
Step 10: Click on the Manage NuGet Packages for Solution
menu item
Step 11: Update the Microsoft.Bot.Builder package
Step 12: Click on the Build menu and then select the Publish
menu item
Step 13: Click on the Publish button
Step 14: Create a new Resource Group
Step 15: Create a new App Service Plan
Step 16: Click on the Create button
Step 17: Deploying the App Service
Every Bot needs to have a brain, so before we can continue
on we will want to build a Bot Service that we can deploy to
Azure.
Creating and Deploying a Bot Service through Visual Studio 2017
Creating a Bot Service
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
We will do this through Visual Studio 2017.
So the next thing to do is to open up Visual Studio and
then click on the Create new project link in the Start Page.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 1: Open up Visual Studio
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
This will open up the New Project dialog box and we will
want to select the Bot Application.
To do this, find the Bot Application template within the
Template list.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 2: Select the Bot Application template
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
Then change the Name for the project to be something a
little less generic.
For this example we set the Project Name to
VoightKampffBot.
After we have done that we can just click on the OK button
to create the project.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 3: Change the Project Name
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
This will create our new Bot project for us.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 4: Create the Bot Service project
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
Now that we have our Bot project, we will want to link it
with our Bot registration information that we created
earlier.
To do this, double click on the web.config file within the
Solution Explorer.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 5: Open up the web.config
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
Within the web.config file there are some keys that we will
want to update to link it with the Azure Bot service.
To start with, update the BotId key with the ID that we
registered earlier.
For this bot we set the BotId key to VoightKempffBot.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 6: Update the BotId key
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
Next, paste the AppId into the MicrosoftAppId key.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 7: Update the AppId key
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
Then, paste the Password into the MicrosoftAppPassword
key.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 8: Update the MicrosoftAppPassword
key
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
If this is the first time that we are doing this, if we open up
the MessageController.cs class in the Solution Explorer
then we may see that there are a number of errors that are
showing up in the code.
Don’t worry, this is just because we do not have the latest
version of the Bot Framework extensions.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 9: Open the MessageController.cs file
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
To fix this, we just have to update the NuGet package for
the Bot Framework.
To do this, click on the Tools menu, then select the NuGet
Package Manager, and then click on the Manage NuGet
Packages for Solution menu item.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 10: Click on the Manage NuGet
Packages for Solution menu item
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
When the Solution manager is displayed, if we look at the
Updates that need to be applied we will probably see that
the Microsoft.Bot.Builder package needs an update.
All we need to do here is select the Microsoft.Bot.Builder
package and then click on the Update button.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 11: Update the Microsoft.Bot.Builder
package
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
When we return back to our code we should see that all of
the errors magically disappear.
Now we will just want to publish our bot.
To do this, click on the Build menu and then select the
Publish menu item.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 12: Click on the Build menu and then
select the Publish menu item
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
This will open up the Publish wizard.
The Microsoft Azure App Service should already be
selected.
All we need to do here is click on the Publish button.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 13: Click on the Publish button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
This will open up a Create App Service dialog box where
we can define the App Service properties for the Bot.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 13: Click on the Publish button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
Before we create the service though we will want to make a
couple of changes.
The first change that we will make is to create a new
Resource Group for the service.
To do this, just click on the New button beside the
Resource Group and then enter in a New resource group
name.
For this Bot we changed the New Resource Group Name
to VoughtKempffBot.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 14: Create a new Resource Group
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
Also, we may want to put our bot on its own App Service
Plan.
The App Service Plans host the actual service and are
Azure servers. Keep in mind that depending on the type of
App Service that you choose from, this may cost money. So
before you chew up all of your Azure credits, check the
pricing here: https://azure.microsoft.com/en-
us/pricing/details/app-service/
For example, the S1 App Service will run around $75 a
month.
To do this, just click on the New button beside the App
Service Plan, and then click on the OK button.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 15: Create a new App Service Plan
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
Now that we have configured our App Service all that is
left to do is to create it.
All you need to do here is click on the Create button.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 16: Click on the Create button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
This will start the deployment of the App Service.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 17: Deploying the App Service
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
When the App Service is deployed we will return back to
the Publish form and Visual Studio will continue with the
publishing of the Bot.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 17: Deploying the App Service
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Creating a Bot Service
After a few seconds the Bot Service will be published and
then a browser window will open up and take us to the new
Bot Service endpoint.
All we need to do here is note down the URL of the Bot
Service.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 17: Deploying the App Service
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Step 1: Update the Bot Messaging endpoint
Step 2: Click on the Register button
Step 3: Click on the OK button
Step 4: Click on the Test button
Step 5: Say hi to your Bot
Now that we have created our basic service we can return
back to the Bot Registration form and link our Bot Service
to the Bot itself.
Creating and Deploying a Bot Service through Visual Studio 2017
Linking the Bot Service to the Bot App
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Linking the Bot Service to the Bot App
Now we will want to link the Bot Service with the Bot.
To do this we just paste the URL of the bot into the
Messaging endpoint field with a couple of changes.
First, change the URL from http:// to https://.
And then add /api/messages to the end of the URL.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 1: Update the Bot Messaging endpoint
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Linking the Bot Service to the Bot App
Now we can finish the registration process.
All we need to do now is click on the Register button at the
bottom of the form.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 2: Click on the Register button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Linking the Bot Service to the Bot App
We will then get a message saying that the Bot has been
created.
Just click on the OK button.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 3: Click on the OK button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Linking the Bot Service to the Bot App
This will take us to our Bot details page.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 3: Click on the OK button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Linking the Bot Service to the Bot App
Before we move on we will want to make sure that our Bot
is really working.
To do this, just click on the Test button.
If everything is working properly we will see a message
saying the the Endpoint authorization succeeded.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 4: Click on the Test button
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Linking the Bot Service to the Bot App
Also if we like, we can test the interaction with the report.
To do this, just type in something into the Chat window.
For example, just say hi.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 5: Say hi to your Bot
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Step 1: Click on the Add link for the Teams Channel
Step 2: Click on the I’m done configuring Microsoft Teams
Step 3: Click on the Add to teams link
Step 4: Say hi again
Now that we have the Bot out in the wild we can start
adding it to some Channels.
Creating and Deploying a Bot Service through Visual Studio 2017
Publishing the Bot to Channels
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Publishing the Bot to Channels
If we scroll down in the Bot details we will see all of the
different Channels that we can publish the Bot to. Sone
have already been selected, but for this example we want to
make the Bot available through Teams.
So all we need to do here is click on the Add link for the
Teams Channel.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 1: Click on the Add link for the Teams
Channel
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Publishing the Bot to Channels
This will open the settings for the Teams Channel and
enable it.
All we need to do here is click on the I’m done configuring
Microsoft Teams button at the bottom of the page.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 2: Click on the I’m done configuring
Microsoft Teams
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Publishing the Bot to Channels
Now Teams will be in the enabled Channels.
Now we just want to add the Bot to Teams so that we can
use it.
To do this, all we need to do is click on the Add to teams
link.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 3: Click on the Add to teams link
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Publishing the Bot to Channels
This will make the Bot show up within Teams.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 3: Click on the Add to teams link
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
Publishing the Bot to Channels
If we want to make sure that the Bot is really there, just
start interacting with it.
For example, just say hi again.
Creating and Deploying a Bot Service through Visual Studio 2017
Step 4: Say hi again
www.microsoft.com
© 2017 Microsoft Corporation. All rights reserved.
How easy was that!
Now that we have a Bot published we just need to teach it how to
be a little more helpful.
Review
Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio
About the Author
Murray Fife is an Author of over 20 books on Microsoft Dynamics including the Bare Bones
Configuration Guide series. These guides comprise of over 15 books which step you through
the setup and configuration of Microsoft Dynamics including Finance, Operations, Human
Resources, Production, Service Management, and Project Accounting.
Throughout his 25+ years of experience in the software industry he has worked in many
different roles during his career, including as a developer, an implementation consultant, a
trainer and a demo guy within the partner channel which gives him a great understanding of
the requirements for both customers and partners perspective.
If you are interested in contacting Murray or want to follow his blogs and posts then here is
all of his contact information:
Email: murray@murrayfife.com
IM/Skype: murrayfife
Twitter: @murrayfife
Facebook: facebook.com/murraycfife
Google: google.com/+murrayfife
LinkedIn: linkedin.com/in/murrayfife
Blog: atinkerersnotebook.com
Docs: docs.com/atinkerersnotebook
SlideShare: slideshare.net/murrayfife
Amazon: amazon.com/author/murrayfife
© 2017 Microsoft Corporation. All rights reserved.
This document is provided “as-is.” Information and views expressed in this document,
including URL and other Internet Web site references, may change without notice. You bear
the risk of using it.
Some examples are for illustration only and are fictitious. No real association is intended or
inferred.
This document does not provide you with any legal rights to any intellectual property in any
Microsoft product. You may copy and use this document for your internal, reference
purposes.
Microsoft Dynamics is a line of integrated, adaptable business management solutions
that enables you and your people to make business decisions with greater confidence.
Microsoft Dynamics works like and with familiar Microsoft software, automating and
streamlining financial, customer relationship, and supply chain processes in a way that
helps you drive business success.
United States and Canada toll-free: (888) 477-7989
Worldwide: (1) (701) 281-6500
www.microsoft.com/dynamics

More Related Content

What's hot

Team project app
Team project appTeam project app
Team project app
Dineshisaac
 
CREATING A WIKI WEBSITE
CREATING A WIKI WEBSITECREATING A WIKI WEBSITE
CREATING A WIKI WEBSITE
Justin Toth
 
DevelopmentIntegrationGuides-Warbler
DevelopmentIntegrationGuides-WarblerDevelopmentIntegrationGuides-Warbler
DevelopmentIntegrationGuides-Warbler
Mark Dunlap
 

What's hot (17)

How to integrate a subscription form with WordPress using a free plugin?
How to integrate a subscription form with WordPress using a free plugin?How to integrate a subscription form with WordPress using a free plugin?
How to integrate a subscription form with WordPress using a free plugin?
 
Team project app
Team project appTeam project app
Team project app
 
App Development: Create Cross Platform Mobile App with .NETStandard 2.0
App Development: Create Cross Platform Mobile App with .NETStandard 2.0App Development: Create Cross Platform Mobile App with .NETStandard 2.0
App Development: Create Cross Platform Mobile App with .NETStandard 2.0
 
CREATING A WIKI WEBSITE
CREATING A WIKI WEBSITECREATING A WIKI WEBSITE
CREATING A WIKI WEBSITE
 
Certification Tasks
Certification TasksCertification Tasks
Certification Tasks
 
Girl Scouts Website Designer Badge Seminar - Workbook
Girl Scouts Website Designer Badge Seminar - WorkbookGirl Scouts Website Designer Badge Seminar - Workbook
Girl Scouts Website Designer Badge Seminar - Workbook
 
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twistIntro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
 
IE9 for developers
IE9 for developersIE9 for developers
IE9 for developers
 
Orangescrum Invoice Pro Add-on user manual
Orangescrum Invoice Pro Add-on user manualOrangescrum Invoice Pro Add-on user manual
Orangescrum Invoice Pro Add-on user manual
 
Bot Framework with Xamarin Forms
Bot Framework with Xamarin FormsBot Framework with Xamarin Forms
Bot Framework with Xamarin Forms
 
Create your website in just 1 hour
Create your website in just 1 hourCreate your website in just 1 hour
Create your website in just 1 hour
 
DirectLineAPI - Xamarin.Forms App and Bot Framework Integration
DirectLineAPI - Xamarin.Forms App and Bot Framework IntegrationDirectLineAPI - Xamarin.Forms App and Bot Framework Integration
DirectLineAPI - Xamarin.Forms App and Bot Framework Integration
 
DevelopmentIntegrationGuides-Warbler
DevelopmentIntegrationGuides-WarblerDevelopmentIntegrationGuides-Warbler
DevelopmentIntegrationGuides-Warbler
 
Introduction to SharePoint 2013 Apps
Introduction to SharePoint 2013 AppsIntroduction to SharePoint 2013 Apps
Introduction to SharePoint 2013 Apps
 
3 easy ways to display recent tweets in word press
3 easy ways to display recent tweets in word press3 easy ways to display recent tweets in word press
3 easy ways to display recent tweets in word press
 
Salesforce.com Lightning
Salesforce.com LightningSalesforce.com Lightning
Salesforce.com Lightning
 
Girl Scouts Website Designer Badge Seminar - Presentation Slides
Girl Scouts Website Designer Badge Seminar - Presentation SlidesGirl Scouts Website Designer Badge Seminar - Presentation Slides
Girl Scouts Website Designer Badge Seminar - Presentation Slides
 

Similar to Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio

Similar to Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio (20)

Facebook SSO.docx
Facebook SSO.docxFacebook SSO.docx
Facebook SSO.docx
 
Ct bot tutorial
Ct bot tutorialCt bot tutorial
Ct bot tutorial
 
Money robot software - Best Link Building Software 2020
Money robot software - Best Link Building Software 2020Money robot software - Best Link Building Software 2020
Money robot software - Best Link Building Software 2020
 
Add ChatGPT to WordPress A Step-by-Step Guide for Beginners.pdf
Add ChatGPT to WordPress A Step-by-Step Guide for Beginners.pdfAdd ChatGPT to WordPress A Step-by-Step Guide for Beginners.pdf
Add ChatGPT to WordPress A Step-by-Step Guide for Beginners.pdf
 
Creating an Uber Clone - Part XXXIII - Transcript.pdf
Creating an Uber Clone - Part XXXIII - Transcript.pdfCreating an Uber Clone - Part XXXIII - Transcript.pdf
Creating an Uber Clone - Part XXXIII - Transcript.pdf
 
Chatbot development with Microsoft Bot Framework
Chatbot development with Microsoft Bot FrameworkChatbot development with Microsoft Bot Framework
Chatbot development with Microsoft Bot Framework
 
Setting up your ring central sandbox in steps
Setting up your ring central sandbox in stepsSetting up your ring central sandbox in steps
Setting up your ring central sandbox in steps
 
Let's Build a Chatbot
Let's Build a ChatbotLet's Build a Chatbot
Let's Build a Chatbot
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
 
Facebook_Coin
Facebook_CoinFacebook_Coin
Facebook_Coin
 
Here's How to Create a Chatbot for your B2B Website
Here's How to Create a Chatbot for your B2B WebsiteHere's How to Create a Chatbot for your B2B Website
Here's How to Create a Chatbot for your B2B Website
 
MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...
 
CI & CD- mobile application
CI & CD- mobile applicationCI & CD- mobile application
CI & CD- mobile application
 
Create and manage a web application on Azure (step to step tutorial)
Create and manage a web application on Azure (step to step tutorial)Create and manage a web application on Azure (step to step tutorial)
Create and manage a web application on Azure (step to step tutorial)
 
Dynamics 365 self hosting bots
Dynamics 365 self hosting botsDynamics 365 self hosting bots
Dynamics 365 self hosting bots
 
Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
 
Summary Of Polycom Cast App
Summary Of Polycom Cast AppSummary Of Polycom Cast App
Summary Of Polycom Cast App
 
Streamlining React Component Development and Sharing with bit.pptx
Streamlining React Component Development and Sharing with bit.pptxStreamlining React Component Development and Sharing with bit.pptx
Streamlining React Component Development and Sharing with bit.pptx
 
Web services in asp.net
Web services in asp.netWeb services in asp.net
Web services in asp.net
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio

  • 1. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio Murray Fife mufife@microsoft.com June 2017
  • 2. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot Creating a Bot Service Linking the Bot Service to the Bot App Publishing the Bot to Channels Bots are great, and really easy to create with Visual Studio and the Bot Framework. But if you want to take your Bots to the next level then you really want to set them free and deploy them to the cloud as a Bot Service. In this quick walkthrough we will show you how you can do just that. Creating and Deploying a Bot Service through Visual Studio 2017
  • 3. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Step 1: Go to the Bot Framework site Step 2: Click on Register a bot Step 3: Set the Bot Name Step 4: Add a Bot handle for the Bot Step 5: Add a Description for the Bot Step 6: Click on the Create Microsoft App ID and password button Step 7: Login using your Microsoft Account Step 8: Click on the Generate an app password to continue button Step 9: Click on the Finish and go back to Bot Framework button The first thing that we need to do is to register our Bot. Creating and Deploying a Bot Service through Visual Studio 2017 Registering a Bot
  • 4. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot We can register our Bots through the Bot Framework site. So open up the Bot Framework website by browsing to dev.botframework.com. Creating and Deploying a Bot Service through Visual Studio 2017 Step 1: Go to the Bot Framework site
  • 5. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot Now that we are on the Bot Framework site we can start registering a new Bot. To do this, just click on the Register a bot link at the top of the page. This will open up the Bot Registration form where we can start the setup of our Bot Service. Creating and Deploying a Bot Service through Visual Studio 2017 Step 2: Click on Register a bot
  • 6. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot We will start off the registration process by giving our Bot a name. We do that by entering our Bots name into the Name field. For this Bot we set the Name to VoightKampffBot. Creating and Deploying a Bot Service through Visual Studio 2017 Step 3: Set the Bot Name
  • 7. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot Next we will want to give out Bot a Handle. The Handle will be the name that is used by the Bot whenever it is interacting with you. To do this, just enter a value into the Bot handle field. For this Bot we set the Bot handle to Voight-Kampff. Creating and Deploying a Bot Service through Visual Studio 2017 Step 4: Add a Bot handle for the Bot
  • 8. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot If we want, we can also give our Bot a Description to give people a general idea as to what our Bot does. To do this, just enter in an overview of the Bot into the Description field. Creating and Deploying a Bot Service through Visual Studio 2017 Step 5: Add a Description for the Bot
  • 9. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot Now that we have entered in the profile information for the Bot, we can move on to setting up the Configuration details. If we scroll down on the Bot creation page then we will see that there are some more details within the Configuration section that we need to specify. The first one that we will want to fill in is the App ID, which is the unique identifier for the Bot, which we need to create. To create a new App ID, click on the Create Microsoft App ID and password button. Creating and Deploying a Bot Service through Visual Studio 2017 Step 6: Click on the Create Microsoft App ID and password button
  • 10. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot This will take us to a login page where we need to log in with a Microsoft account. Creating and Deploying a Bot Service through Visual Studio 2017 Step 7: Login using your Microsoft Account
  • 11. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot After we have logged in, we will be taken to a Generate App ID and Password page. The App name will be automatically populated from the Bot registration form, and also a unique App ID will be created for us, which we will want to note down. All we need to do is to create an app password. To do this, click on the Generate an app password to continue button. Creating and Deploying a Bot Service through Visual Studio 2017 Step 8: Click on the Generate an app password to continue button
  • 12. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot This will open up a dialog box with a new App password. Note down the App password and then click on the OK button to exit from the form. Note: This will be the only time that you will be able to see this password, so make sure you copy it down. Creating and Deploying a Bot Service through Visual Studio 2017 Step 8: Click on the Generate an app password to continue button
  • 13. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Registering a Bot Now that we have our App ID and our Password we can return back to the Bot registration page and assign the App ID to our Bot. To do this, just click on the Finish and go back to Bot Framework button. When we return to the Bot registration form, we can then paste our App Id into the App Id field in the form. Creating and Deploying a Bot Service through Visual Studio 2017 Step 9: Click on the Finish and go back to Bot Framework button
  • 14. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Step 1: Open up Visual Studio Step 2: Select the Bot Application template Step 3: Change the Project Name Step 4: Create the Bot Service project Step 5: Open up the web.config Step 6: Update the BotId key Step 7: Update the AppId key Step 8: Update the MicrosoftAppPassword key Step 9: Open the MessageController.cs file Step 10: Click on the Manage NuGet Packages for Solution menu item Step 11: Update the Microsoft.Bot.Builder package Step 12: Click on the Build menu and then select the Publish menu item Step 13: Click on the Publish button Step 14: Create a new Resource Group Step 15: Create a new App Service Plan Step 16: Click on the Create button Step 17: Deploying the App Service Every Bot needs to have a brain, so before we can continue on we will want to build a Bot Service that we can deploy to Azure. Creating and Deploying a Bot Service through Visual Studio 2017 Creating a Bot Service
  • 15. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service We will do this through Visual Studio 2017. So the next thing to do is to open up Visual Studio and then click on the Create new project link in the Start Page. Creating and Deploying a Bot Service through Visual Studio 2017 Step 1: Open up Visual Studio
  • 16. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service This will open up the New Project dialog box and we will want to select the Bot Application. To do this, find the Bot Application template within the Template list. Creating and Deploying a Bot Service through Visual Studio 2017 Step 2: Select the Bot Application template
  • 17. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service Then change the Name for the project to be something a little less generic. For this example we set the Project Name to VoightKampffBot. After we have done that we can just click on the OK button to create the project. Creating and Deploying a Bot Service through Visual Studio 2017 Step 3: Change the Project Name
  • 18. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service This will create our new Bot project for us. Creating and Deploying a Bot Service through Visual Studio 2017 Step 4: Create the Bot Service project
  • 19. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service Now that we have our Bot project, we will want to link it with our Bot registration information that we created earlier. To do this, double click on the web.config file within the Solution Explorer. Creating and Deploying a Bot Service through Visual Studio 2017 Step 5: Open up the web.config
  • 20. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service Within the web.config file there are some keys that we will want to update to link it with the Azure Bot service. To start with, update the BotId key with the ID that we registered earlier. For this bot we set the BotId key to VoightKempffBot. Creating and Deploying a Bot Service through Visual Studio 2017 Step 6: Update the BotId key
  • 21. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service Next, paste the AppId into the MicrosoftAppId key. Creating and Deploying a Bot Service through Visual Studio 2017 Step 7: Update the AppId key
  • 22. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service Then, paste the Password into the MicrosoftAppPassword key. Creating and Deploying a Bot Service through Visual Studio 2017 Step 8: Update the MicrosoftAppPassword key
  • 23. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service If this is the first time that we are doing this, if we open up the MessageController.cs class in the Solution Explorer then we may see that there are a number of errors that are showing up in the code. Don’t worry, this is just because we do not have the latest version of the Bot Framework extensions. Creating and Deploying a Bot Service through Visual Studio 2017 Step 9: Open the MessageController.cs file
  • 24. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service To fix this, we just have to update the NuGet package for the Bot Framework. To do this, click on the Tools menu, then select the NuGet Package Manager, and then click on the Manage NuGet Packages for Solution menu item. Creating and Deploying a Bot Service through Visual Studio 2017 Step 10: Click on the Manage NuGet Packages for Solution menu item
  • 25. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service When the Solution manager is displayed, if we look at the Updates that need to be applied we will probably see that the Microsoft.Bot.Builder package needs an update. All we need to do here is select the Microsoft.Bot.Builder package and then click on the Update button. Creating and Deploying a Bot Service through Visual Studio 2017 Step 11: Update the Microsoft.Bot.Builder package
  • 26. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service When we return back to our code we should see that all of the errors magically disappear. Now we will just want to publish our bot. To do this, click on the Build menu and then select the Publish menu item. Creating and Deploying a Bot Service through Visual Studio 2017 Step 12: Click on the Build menu and then select the Publish menu item
  • 27. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service This will open up the Publish wizard. The Microsoft Azure App Service should already be selected. All we need to do here is click on the Publish button. Creating and Deploying a Bot Service through Visual Studio 2017 Step 13: Click on the Publish button
  • 28. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service This will open up a Create App Service dialog box where we can define the App Service properties for the Bot. Creating and Deploying a Bot Service through Visual Studio 2017 Step 13: Click on the Publish button
  • 29. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service Before we create the service though we will want to make a couple of changes. The first change that we will make is to create a new Resource Group for the service. To do this, just click on the New button beside the Resource Group and then enter in a New resource group name. For this Bot we changed the New Resource Group Name to VoughtKempffBot. Creating and Deploying a Bot Service through Visual Studio 2017 Step 14: Create a new Resource Group
  • 30. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service Also, we may want to put our bot on its own App Service Plan. The App Service Plans host the actual service and are Azure servers. Keep in mind that depending on the type of App Service that you choose from, this may cost money. So before you chew up all of your Azure credits, check the pricing here: https://azure.microsoft.com/en- us/pricing/details/app-service/ For example, the S1 App Service will run around $75 a month. To do this, just click on the New button beside the App Service Plan, and then click on the OK button. Creating and Deploying a Bot Service through Visual Studio 2017 Step 15: Create a new App Service Plan
  • 31. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service Now that we have configured our App Service all that is left to do is to create it. All you need to do here is click on the Create button. Creating and Deploying a Bot Service through Visual Studio 2017 Step 16: Click on the Create button
  • 32. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service This will start the deployment of the App Service. Creating and Deploying a Bot Service through Visual Studio 2017 Step 17: Deploying the App Service
  • 33. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service When the App Service is deployed we will return back to the Publish form and Visual Studio will continue with the publishing of the Bot. Creating and Deploying a Bot Service through Visual Studio 2017 Step 17: Deploying the App Service
  • 34. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Creating a Bot Service After a few seconds the Bot Service will be published and then a browser window will open up and take us to the new Bot Service endpoint. All we need to do here is note down the URL of the Bot Service. Creating and Deploying a Bot Service through Visual Studio 2017 Step 17: Deploying the App Service
  • 35. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Step 1: Update the Bot Messaging endpoint Step 2: Click on the Register button Step 3: Click on the OK button Step 4: Click on the Test button Step 5: Say hi to your Bot Now that we have created our basic service we can return back to the Bot Registration form and link our Bot Service to the Bot itself. Creating and Deploying a Bot Service through Visual Studio 2017 Linking the Bot Service to the Bot App
  • 36. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Linking the Bot Service to the Bot App Now we will want to link the Bot Service with the Bot. To do this we just paste the URL of the bot into the Messaging endpoint field with a couple of changes. First, change the URL from http:// to https://. And then add /api/messages to the end of the URL. Creating and Deploying a Bot Service through Visual Studio 2017 Step 1: Update the Bot Messaging endpoint
  • 37. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Linking the Bot Service to the Bot App Now we can finish the registration process. All we need to do now is click on the Register button at the bottom of the form. Creating and Deploying a Bot Service through Visual Studio 2017 Step 2: Click on the Register button
  • 38. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Linking the Bot Service to the Bot App We will then get a message saying that the Bot has been created. Just click on the OK button. Creating and Deploying a Bot Service through Visual Studio 2017 Step 3: Click on the OK button
  • 39. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Linking the Bot Service to the Bot App This will take us to our Bot details page. Creating and Deploying a Bot Service through Visual Studio 2017 Step 3: Click on the OK button
  • 40. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Linking the Bot Service to the Bot App Before we move on we will want to make sure that our Bot is really working. To do this, just click on the Test button. If everything is working properly we will see a message saying the the Endpoint authorization succeeded. Creating and Deploying a Bot Service through Visual Studio 2017 Step 4: Click on the Test button
  • 41. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Linking the Bot Service to the Bot App Also if we like, we can test the interaction with the report. To do this, just type in something into the Chat window. For example, just say hi. Creating and Deploying a Bot Service through Visual Studio 2017 Step 5: Say hi to your Bot
  • 42. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Step 1: Click on the Add link for the Teams Channel Step 2: Click on the I’m done configuring Microsoft Teams Step 3: Click on the Add to teams link Step 4: Say hi again Now that we have the Bot out in the wild we can start adding it to some Channels. Creating and Deploying a Bot Service through Visual Studio 2017 Publishing the Bot to Channels
  • 43. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Publishing the Bot to Channels If we scroll down in the Bot details we will see all of the different Channels that we can publish the Bot to. Sone have already been selected, but for this example we want to make the Bot available through Teams. So all we need to do here is click on the Add link for the Teams Channel. Creating and Deploying a Bot Service through Visual Studio 2017 Step 1: Click on the Add link for the Teams Channel
  • 44. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Publishing the Bot to Channels This will open the settings for the Teams Channel and enable it. All we need to do here is click on the I’m done configuring Microsoft Teams button at the bottom of the page. Creating and Deploying a Bot Service through Visual Studio 2017 Step 2: Click on the I’m done configuring Microsoft Teams
  • 45. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Publishing the Bot to Channels Now Teams will be in the enabled Channels. Now we just want to add the Bot to Teams so that we can use it. To do this, all we need to do is click on the Add to teams link. Creating and Deploying a Bot Service through Visual Studio 2017 Step 3: Click on the Add to teams link
  • 46. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Publishing the Bot to Channels This will make the Bot show up within Teams. Creating and Deploying a Bot Service through Visual Studio 2017 Step 3: Click on the Add to teams link
  • 47. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. Publishing the Bot to Channels If we want to make sure that the Bot is really there, just start interacting with it. For example, just say hi again. Creating and Deploying a Bot Service through Visual Studio 2017 Step 4: Say hi again
  • 48. www.microsoft.com © 2017 Microsoft Corporation. All rights reserved. How easy was that! Now that we have a Bot published we just need to teach it how to be a little more helpful. Review Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio
  • 49. About the Author Murray Fife is an Author of over 20 books on Microsoft Dynamics including the Bare Bones Configuration Guide series. These guides comprise of over 15 books which step you through the setup and configuration of Microsoft Dynamics including Finance, Operations, Human Resources, Production, Service Management, and Project Accounting. Throughout his 25+ years of experience in the software industry he has worked in many different roles during his career, including as a developer, an implementation consultant, a trainer and a demo guy within the partner channel which gives him a great understanding of the requirements for both customers and partners perspective. If you are interested in contacting Murray or want to follow his blogs and posts then here is all of his contact information: Email: murray@murrayfife.com IM/Skype: murrayfife Twitter: @murrayfife Facebook: facebook.com/murraycfife Google: google.com/+murrayfife LinkedIn: linkedin.com/in/murrayfife Blog: atinkerersnotebook.com Docs: docs.com/atinkerersnotebook SlideShare: slideshare.net/murrayfife Amazon: amazon.com/author/murrayfife
  • 50. © 2017 Microsoft Corporation. All rights reserved. This document is provided “as-is.” Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. Some examples are for illustration only and are fictitious. No real association is intended or inferred. This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. Microsoft Dynamics is a line of integrated, adaptable business management solutions that enables you and your people to make business decisions with greater confidence. Microsoft Dynamics works like and with familiar Microsoft software, automating and streamlining financial, customer relationship, and supply chain processes in a way that helps you drive business success. United States and Canada toll-free: (888) 477-7989 Worldwide: (1) (701) 281-6500 www.microsoft.com/dynamics

Editor's Notes

  1. Bots are great, and really easy to create with Visual Studio and the Bot Framework. But if you want to take your Bots to the next level then you really want to set them free and deploy them to the cloud as a Bot Service. In this quick walkthrough we will show you how you can do just that.
  2. The first thing that we need to do is to register our Bot.
  3. We can register our Bots through the Bot Framework site. So open up the Bot Framework website by browsing to dev.botframework.com.
  4. Now that we are on the Bot Framework site we can start registering a new Bot. To do this, just click on the Register a bot link at the top of the page. This will open up the Bot Registration form where we can start the setup of our Bot Service.
  5. We will start off the registration process by giving our Bot a name. We do that by entering our Bots name into the Name field. For this Bot we set the Name to VoightKampffBot.Name: Set to VoightKampffBot
  6. Next we will want to give out Bot a Handle. The Handle will be the name that is used by the Bot whenever it is interacting with you. To do this, just enter a value into the Bot handle field. For this Bot we set the Bot handle to Voight-Kampff.Bot handle: Set to Voight-Kampff
  7. If we want, we can also give our Bot a Description to give people a general idea as to what our Bot does. To do this, just enter in an overview of the Bot into the Description field.
  8. Now that we have entered in the profile information for the Bot, we can move on to setting up the Configuration details. If we scroll down on the Bot creation page then we will see that there are some more details within the Configuration section that we need to specify. The first one that we will want to fill in is the App ID, which is the unique identifier for the Bot, which we need to create. To create a new App ID, click on the Create Microsoft App ID and password button.
  9. This will take us to a login page where we need to log in with a Microsoft account.
  10. After we have logged in, we will be taken to a Generate App ID and Password page. The App name will be automatically populated from the Bot registration form, and also a unique App ID will be created for us, which we will want to note down. All we need to do is to create an app password. To do this, click on the Generate an app password to continue button.
  11. This will open up a dialog box with a new App password. Note down the App password and then click on the OK button to exit from the form. Note: This will be the only time that you will be able to see this password, so make sure you copy it down.
  12. Now that we have our App ID and our Password we can return back to the Bot registration page and assign the App ID to our Bot. To do this, just click on the Finish and go back to Bot Framework button. When we return to the Bot registration form, we can then paste our App Id into the App Id field in the form.
  13. Every Bot needs to have a brain, so before we can continue on we will want to build a Bot Service that we can deploy to Azure.
  14. We will do this through Visual Studio 2017. So the next thing to do is to open up Visual Studio and then click on the Create new project link in the Start Page.
  15. This will open up the New Project dialog box and we will want to select the Bot Application. To do this, find the Bot Application template within the Template list.
  16. Then change the Name for the project to be something a little less generic. For this example we set the Project Name to VoightKampffBot. After we have done that we can just click on the OK button to create the project.Name: Change to VoightKampffBot
  17. This will create our new Bot project for us.
  18. Now that we have our Bot project, we will want to link it with our Bot registration information that we created earlier. To do this, double click on the web.config file within the Solution Explorer.
  19. Within the web.config file there are some keys that we will want to update to link it with the Azure Bot service. To start with, update the BotId key with the ID that we registered earlier. For this bot we set the BotId key to VoightKempffBot.BotId: Set to VoightKempffBot
  20. Next, paste the AppId into the MicrosoftAppId key.MicrosoftAppId: Paste in the AppId
  21. Then, paste the Password into the MicrosoftAppPassword key.MicrosoftAppPassword: Paste in the Password
  22. If this is the first time that we are doing this, if we open up the MessageController.cs class in the Solution Explorer then we may see that there are a number of errors that are showing up in the code. Don’t worry, this is just because we do not have the latest version of the Bot Framework extensions.
  23. To fix this, we just have to update the NuGet package for the Bot Framework. To do this, click on the Tools menu, then select the NuGet Package Manager, and then click on the Manage NuGet Packages for Solution menu item.Tools > NuGet Package Manager > Manage NuGet Packages for Solution
  24. When the Solution manager is displayed, if we look at the Updates that need to be applied we will probably see that the Microsoft.Bot.Builder package needs an update. All we need to do here is select the Microsoft.Bot.Builder package and then click on the Update button.
  25. When we return back to our code we should see that all of the errors magically disappear. Now we will just want to publish our bot. To do this, click on the Build menu and then select the Publish menu item.Build > Publish
  26. This will open up the Publish wizard. The Microsoft Azure App Service should already be selected. All we need to do here is click on the Publish button.
  27. This will open up a Create App Service dialog box where we can define the App Service properties for the Bot.
  28. Before we create the service though we will want to make a couple of changes. The first change that we will make is to create a new Resource Group for the service. To do this, just click on the New button beside the Resource Group and then enter in a New resource group name. For this Bot we changed the New Resource Group Name to VoughtKempffBot.New Resource Group Name: Change to VoughtKempffBot
  29. Also, we may want to put our bot on its own App Service Plan. The App Service Plans host the actual service and are Azure servers. Keep in mind that depending on the type of App Service that you choose from, this may cost money. So before you chew up all of your Azure credits, check the pricing here: https://azure.microsoft.com/en-us/pricing/details/app-service/ For example, the S1 App Service will run around $75 a month. To do this, just click on the New button beside the App Service Plan, and then click on the OK button.
  30. Now that we have configured our App Service all that is left to do is to create it. All you need to do here is click on the Create button.
  31. This will start the deployment of the App Service.
  32. When the App Service is deployed we will return back to the Publish form and Visual Studio will continue with the publishing of the Bot.
  33. After a few seconds the Bot Service will be published and then a browser window will open up and take us to the new Bot Service endpoint. All we need to do here is note down the URL of the Bot Service.
  34. Now that we have created our basic service we can return back to the Bot Registration form and link our Bot Service to the Bot itself.
  35. Now we will want to link the Bot Service with the Bot. To do this we just paste the URL of the bot into the Messaging endpoint field with a couple of changes. First, change the URL from http:// to https://. And then add /api/messages to the end of the URL.
  36. Now we can finish the registration process. All we need to do now is click on the Register button at the bottom of the form.
  37. We will then get a message saying that the Bot has been created. Just click on the OK button.
  38. This will take us to our Bot details page.
  39. Before we move on we will want to make sure that our Bot is really working. To do this, just click on the Test button. If everything is working properly we will see a message saying the the Endpoint authorization succeeded.
  40. Also if we like, we can test the interaction with the report. To do this, just type in something into the Chat window. For example, just say hi.
  41. Now that we have the Bot out in the wild we can start adding it to some Channels.
  42. If we scroll down in the Bot details we will see all of the different Channels that we can publish the Bot to. Sone have already been selected, but for this example we want to make the Bot available through Teams. So all we need to do here is click on the Add link for the Teams Channel.
  43. This will open the settings for the Teams Channel and enable it. All we need to do here is click on the I’m done configuring Microsoft Teams button at the bottom of the page.
  44. Now Teams will be in the enabled Channels. Now we just want to add the Bot to Teams so that we can use it. To do this, all we need to do is click on the Add to teams link.
  45. This will make the Bot show up within Teams.
  46. If we want to make sure that the Bot is really there, just start interacting with it. For example, just say hi again.
  47. How easy was that! Now that we have a Bot published we just need to teach it how to be a little more helpful.