---
title: "How to Build and Deploy a Microsoft Teams Bot"
description: "You can either build Microsoft Teams Bot on your own or you can use Knit's Unified API to create it in minutes. We have discussed both the processes here."
source_url: "https://www.getknit.dev/blog/how-to-build-and-deploy-a-microsoft-teams-bot"
page_type: "blog"
---

_This is an educational blog post from Knit's blog: “How to Build and Deploy a Microsoft Teams Bot”._

# How to Build and Deploy a Microsoft Teams Bot

Using Knit's Communication APIs, you can send text as well as interactive messages to any Teams channel or user either using Knit's Bot or your own Bot. In this guide, we will help you understand which kind of bot to use for development and production.

## Using Knit's Teams Bot

> The Knit Unified API's Teams Bot is for only testing and getting familiar with communication APIs. For the production use cases, organizations must setup their own bots.

Using Knit MS Teams bot for communication purpose mainly requires two steps-

### Step I: Adding the Teams link during setup

1.  First, you click on the MS Teams icon in the communication section of Knit apps.
2.  On clicking the MS Teams icon you have to add your Teams link in which the bot needs to be installed \[Check this out [How to get teams link](https://d2mk0xd61wwcji.cloudfront.net/msteams/Teams-LINK-NEW.gif)\]

### Step II: Installing Knit's Bot in the team

1\. The Knit Bot will be installed via a package file provided by us. Click on the _\_\*\*Upload an app\*\*\__

2\. Then choose_\_\*\*Upload a custom app\*\*\__ . Add Knit's Package here. \[[Knit's Bot Package](https://d2mk0xd61wwcji.cloudfront.net/msteams/Knit-MSTeams-Bot.zip)\]

3\. After successful upload a pop-up will open where you click on - _\_\*\*Add to a team\*\*\__

4\. Then select the \_\*\*General\*\*\_ channel in the populated channels list.

> 👍 Congratulations your setup is complete. You can use this Bot for development or testing purpose.

## Using Your own Bot

**_You should use your own Bot in production. Do not use Knit's Bot for production use cases._**

This involves a two step process -

1.  Create your Bot with the MS Teams.
2.  Provide OAuth credentials to knit using \[[Register OAuth Cred](https://developers.getknit.dev/reference/client-oauth-credentials-api)\]

### Create your Bot with MS Teams

1\. First, you need _\_Developer Portal\_ App_ from Microsoft Teams Store to build MS Teams Bot.

2.After Installing it, open and navigate to the _\_ Apps\__ section_._

3\. Now, select the \*\*+\*\* icon to create a new app.

4\. When you add the name of your app, you will be asked to provide the Developer name, terms of use etc in the _\_Basic Information\__ section. Fill out all the details carefully and then click on the  _\_Save\__ button.

 5. Next, visit the _\_Branding\__  section to add your icon and other display information.

6\. Click on the _\_App Features\__ section and select _\_Bot\__.

7\. Next, create one Bot by selecting _\_Create a new Bot\__.

8\. Here, you will see the \*\*+\*\* icon to add a new Bot.

9\. After giving Name to the Bot, you need to configure the endpoint address. Set this to \[[Teams Bot End Point](https://workflow-engine.sandbox.getknit.dev/watchers/wt_T9mktlLzUJ5DPaJqq4wNVI)\]

10\. Click on the _\_Client Secrets\__ option and then _\_Generate Client Secret\__. (Keep this information handy it will be required during OAuth Registration with Knit.)

11\. Now, copy this key as it is a one time secret. After clicking _\_OK \__ you will be shown the below screen and your Bot would have been configured.

12.Now you need to link this bot to your newly created App in _\_Step 6\__. You will see this bot in the dropdown. Select this Bot, then select _\_Team\__ scope and click on _\_Save\__ button.

### Distributing your app to clients

1\. Click on the _\_Publish\__ button on the top right corner in the app home page.

2\. You will see the following options.

To use within your org, select publish to org. For distributing to clients download the package.

3\. If you have followed the right steps and filled in all the necessary information correctly, you will be able to download it.

> If you have missed any of mandatory fields, errors will be listed for missing fields shown in the image below

4\. In the example above, the developer website URL, privacy terms etc. are missing. You need to fix all errors before you can download the package. It can be used to install in any team using steps described in the section \_Using Knit's Teams Bot\_.


## Related pages

- [How Knit works](https://md.getknit.dev/how-knit-works)
- [Unified API product](https://md.getknit.dev/products/unified-api)
