ODC with Bots for Teams - Add Bot to Teams Client


After we got our bot to respond to a user in the previous part of the ODC with Bots for Teams series, we will now add the bot to our Microsoft Teams client application. Although this is a straightforward task, there are some prerequisites you need to meet before you can do this.
An app manifest file connects your bot to the client application. It is a JSON document that describes your bot, its appearance, and behavior within Teams. App manifest files are used not only in Microsoft Teams but also in many other Microsoft 365 applications, providing a unified way to add external app resources to the Microsoft 365 environment.
Manifest documents and its referenced icon resources are packaged into a ZIP file and then deployed to Microsoft Teams clients either
By sideloading into a single Teams client - This is what we will do in this tutorial. We will upload the Teams app to our local Microsoft Teams client.
Distributing it within the organization - You can upload a Teams app to your organization, making it available for on-demand or policy-based installation internally.
Distributing it via the Microsoft Teams Store - You can release your Teams bot/app to the official Microsoft Teams Store to make your solution publicly available. However, your app must meet the store guidelines.
Now, without further ado, let's begin by setting up the prerequisites.
Demo Application
This article series includes a demo application called "ODC with Bots for Teams Demo," available on ODC Forge. Be sure to download the version of the application that matches each article in this series.
For this article, you need to install Version 0.3 from ODC Forge.
In the ODC Portal, go to Forge - All Assets.
Search for "ODC with Bots for Teams Demo".
Click on the Asset (Do not click on Install on the tile!).
Switch to the Version tab and click on Install next to Version 0.3.
Version 0.3 depends on other Forge components:
OAuthTokenExchange - An external logic library that helps retrieve access tokens easily.
Bot Framework Service API - A connector library for using Bot Connector API endpoints.
Allow Sideloading
By default users are not allowed to upload custom apps into Microsoft Teams. This is defined in a Teams Setup Policy that is associated with your user account in the Microsoft Teams Admin center.
In the Microsoft Teams Admin center.
Select Teams apps - Setup policies in the menu
Click Add
Name: OutSystems Bot Developer Setup Policy
Description: Allows an OutSystems Bot developer to sideload Microsoft Teams apps
Click Save
After we have created the policy, we must assign it to one or more users
Select Users - Manage users in the menu
Search your own user account and select it
In the Policies tab click Edit
Select the OutSystems Bot Developer Setup Policy in the Select App setup policy dropdown
Click Apply
Activate Teams Channel
Next, we need to activate Teams channel support in our Bot resource.
In the Azure Portal, select your Bot resource.
Choose Microsoft Teams from the list of Available Channels in the Settings - Channels menu.
Read the Terms of Service and Agree.
In the Messaging tab, select Microsoft Teams Commercial (most common).
Click Apply.
Create the App Manifest File
The demo project includes a template for the manifest file, complete with icons. Download the template archive from Data - Resources in ODC Studio and extract it to a folder.
An app manifest file is a JSON document that follows the unified app manifest schema. Together with the manifest file you will also need two icons.
Full color icon with a size of 192×192
Outline icon with a size of 32×32
Create a folder on your development machine
Copy both icons to the folder
Create a new file manifest.json
Modify id with your bot’s application id from Entra App registration
Modify botId with your bot’s application id from Entra App registration
Check that the icon names match your uploaded icons.
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.19/MicrosoftTeams.schema.json",
"version": "1.0.0",
"manifestVersion": "1.19",
"id": "<Application ID from app registration>",
"name": {
"short": "ODCwithTeams Bot",
"full": "ODCwithTeams Demo Bot"
},
"developer": {
"name": "without.systems",
"websiteUrl": "https://without.systems",
"privacyUrl": "https://without.systems/privacy",
"termsOfUseUrl": "https://without.systems/termsofuse"
},
"description": {
"short": "Shows how to build a bot",
"full": "Full description of your app."
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "<Application ID from app registration>",
"scopes": [
"personal"
],
"isNotificationOnly": false,
"supportsCalling": false,
"supportsVideo": false,
"supportsFiles": false
}
]
}
This is a basic app manifest file, which we will expand on in the upcoming articles of the series. You can find a complete description of the schema here: App Manifest Reference - Teams | Microsoft Learn.
After you have prepared your manifest file, select all the files in the folder (the manifest and icons) and compress them into a zip archive. The name of the zip archive doesn't matter.
Install App to Microsoft Teams
With our package prepared we can now install it to Microsoft Teams. Open your Microsoft Teams client and in the left icon menu click the Apps icon.
On the bottom left click on Manage your apps
In the apps list click the Upload an app button and select Upload a custom app
Select the zip archive you created
Check the details of the app, then click Add
After sucessful upload click the Open button to start a conversation with your bot.
Summary
In this tutorial, we added our Bot to Microsoft Teams. First, we enabled sideloading of Teams apps by creating a new setup policy in the Microsoft Teams Admin Center. Then, we created a manifest application package and uploaded it to a Microsoft Teams client.
Congratulations! This concludes this part of the series. In the next part, we will protect our messaging endpoint, as it is currently publicly available and does not perform any authorization checks.
Feel free to leave a comment with your questions or feedback. See you in the next part!
Subscribe to my newsletter
Read articles from Stefan Weber directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Stefan Weber
Stefan Weber
As a seasoned Senior Director at Telelink Business Services EAD, a leading IT full-service provider headquartered in Sofia, Bulgaria, I lead the charge in our Application Services Practice. In this role, I spearhead the development of tailored software solutions using no-code/low-code platforms and cutting-edge cloud-ready/cloud-native solutions based on the Microsoft .NET stack. Throughout my diverse career, I've accumulated a wealth of experience in various capacities, both technically and personally. The constant desire to create innovative software solutions led me to the world of Low-Code and the OutSystems platform. I remain captivated by how closely OutSystems aligns with traditional software development, offering a seamless experience devoid of limitations. While my managerial responsibilities primarily revolve around leading and inspiring my teams, my passion for solution development with OutSystems remains unwavering. My personal focus extends to integrating our solutions with leading technologies such as Amazon Web Services, Microsoft 365, Azure, and more. In 2023, I earned recognition as an OutSystems Most Valuable Professional, one of only 80 worldwide, and concurrently became an AWS Community Builder.