Building a bot with Botkit and the Microsoft Teams API gives you access to all of the best tools and options available to create a feature-rich app for Teams.
We've created the following guide to help you configure your Microsoft Teams bot. In order to get the best deploy experience possible, we recommend starting with Botkit Studio, our feature-rich tool for building bots!
Before starting to work on your bot, you should enable Developer Preview and the ability to sideload apps for your development team so that you ensure all features are supported.
Botkit Studio is a hosted development environment for building bots with the Botkit core library. Developers using Botkit Studio get the full capabilities of Botkit, plus a full guided setup on creating a bot for Microsoft Teams.
Botkit Studio provides dedicated tools to create your bot's App Package for sideloading and submission to the Office Store. While Botkit Studio is not required, it is strongly recommended as the best way to stand up a bot using Botkit.
For more information about Botkit Studio, including our starter kits for other platforms, please read the Botkit readme on GitHub.
Microsoft Teams first requires you to register with their "Bot Framework" before you can add a bot to your Teams team. This is a multi-step process:
Log into the Bot Framework Developer Portal using your Microsoft credentials, or create an account.
Once you are logged in, click this link to create a new bot and then you can skip the next two steps!
-
Click on
My Bots
and then Register. ChooseCreate a bot with the Bot Builder SDK
, and clickCreate
. -
Select
Register an existing bot built using Bot Builder SDK
from the next menu and then clickOK
.
You will be asked some questions about your bot. Some of these can be changed later, but some cannot be changed so consider your responses carefully!
These are the important fields when creating your bot:
Display name
- Your bot's name in channels and directories. This can be changed later.Bot handle
- This will be used in the URL for your bot. Note: This cannot be changed.Messaging endpoint
- You may not know this yet, as you will be creating this in the next step when setting up the Botkit app. If you are using the Botkit starter kit or Botkit Studio, by default it is:https://YOURURL/teams/receive
. Feel free to make anything up, you can come back later and change it.
Register your bot with Microsoft by clicking: Create Microsoft App ID and password
This action will take you to a new website (and require you to log in again) and then ask you for an App name
.
Once added, it will provide an App ID
which you need to copy somewhere safe to use in the next step.
Next, click Generate password
. This will only be shown to you once, if you lose it, you will need to invalidate the old one and set this up again!
Click Register.
Add the Microsoft Teams channel from the list of channels, making sure the Enabled
is set to on.
You will want to leave this window open as you finish setting up Botkit, as you will need to come back here before you are done.
Now that everything is setup on Microsoft's side, you can run Botkit using the method you've chosen and with the information created in the Bot framework in the previous step.
Once a Botkit instance is running, you may have a new URL that you will have to update in the bot's settings in Microsoft Bot Framework.
Once logged in to that page:
- Click on your bot
- Select settings
- Scroll down to the messaging endpoint field and replace the placeholder URL with your active Botkit URL (it should look something like
https://YOURURL/teams/receive
). - Click Save.
To add a development bot on a team, you will need to prepare an App Package. Botkit Studio provides easy tools to create your App Package, but you can also build this manifest manually if you've chosen to not use Studio.
After creating your app package, you can load it easily into your development team.
Say hello to your real live bot!
Once you have a bot up and running, you can start the fun part of making your bot functional.
You can extend your bot's functionality using various Botkit Middleware, or check our example library for a good starting point.
If you have questions or suggestions, please take a look at our community support resources. You can chat with contributors and enthusiasts in our Slack community.