# Microsoft Teams: Create a Teams App For Additional Functionality  
**Cognigy Support**  
October 24, 2022

Let's assume you have already connected a [Cognigy virtual agent to Microsoft Azure](https://support.cognigy.com/hc/en-us/articles/360016183720) and want it make it available within your organization. You could send a link to the agent to the users they can open directly, however this is not very convenient.

You can also create an app within Microsoft Teams which can be added to your company's internal Microsoft App Store, allowing any employee with the proper rights to directly download and access the agent.

Creating an app for your Cognigy virtual agent will also allow you to add functionality to the agent, for example uploading files or adding the agent to a group chat.

* * *

# Table of Contents  
1. [Creating the App in Developer Portal](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01GB28FX1WCZ9EPE7V23ZA8Y0K)  
1. [Install the App Studio in Microsoft Teams](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01FG1HQGX125TR5G713JC9GEWX)  
2. [Create a new Teams App](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01FG1HQPEYBVKJE0BPV83W3ZNF)  
3. [Set up the Bot](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01FG1HR1PFE9KSW047N33KNCMM)  
4. [Configure an existing Azure Bot Service for group chats](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01FG1HR73W9TJFRBY14JNP2RBK)  
      - [How to find the Azure App ID](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01FG1W31M387B2WR26TP9Y2QNC)  
5. [Publish the new Teams App](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01FG1HRBEDCDXPDA2VC9FMWRYH)  
6. [Admin: Approve and allow the published App](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01FG1S2VG1GZ50GD7CEXQ2251P)  
2. [Adding Bot to Group Chat](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01GB28DFZCE8JEM9SF77P37QQ4)  
1. [Add the new Bot to a conversation](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01FG1HRQH49QQKCYK5ADHE3S8S)  
2. [Example conversation](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01FG1S310HAAZXDN1692SE3WD0)  
3. [Uploading Images via Teams](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01GB2BXYJCRMSHV4G96PKEQ2GQ)

# Creating the App in Developer Portal

## Install the Developer Portal in Microsoft Teams

Inside of Microsoft Teams, the so-called [Developer Portal](https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/teams-developer-portal) is used for this purpose. With this tool, it's possible to install or create apps for an organization. In this case, we will be using it to create a custom app.

## Create a new Teams App

After installing the **Developer Portal**, open it and navigate to the **Apps**. Inside of the editor, click the **\+ New app**:

## Set up the Bot

After providing the general App details, in Step 2, the actual **Bot** can be set up. In order to configure the Cognigy.AI virtual agent as Microsoft Teams Bot, please click the **App Features** and then **Bot**:

## Configure an existing Azure Bot Service for group chats

If you have already created an **Azure Bot Service Endpoint** in Cognigy.AI, the related **Azure App** can be used in this configuration window. However, if not, please follow the instructions in this documentation and create a new Bot Service in Azure:

- [Azure Bot Services: Deploy an Endpoint (Microsoft Teams)](https://support.cognigy.com/hc/en-us/articles/360016183720)

Put your Azure App ID in the **Enter a bot ID** field.

If you want to use your bot to upload and process images click on the **Upload and download files** option.

In the **Scope** section you can determine in what context the bot can be accessed. For a [group chat](https://support.cognigy.com/hc/en-us/articles/4407005594770-Microsoft-Teams-Create-a-Teams-App-For-Additional-Functionality#h_01GB28DFZCE8JEM9SF77P37QQ4), for example, select **Personal** and **Group Chat**.

### How to find the Azure App ID

The ID of an Azure App Registration can be found in the **Configuration** page of the related app:

## Publish the new Teams App

Last but not least, the new Microsoft Teams App (Bot) has to be published to the Teams organization.

## Admin: Approve and allow the published App

The Microsoft Teams Administrator has to **approve** and **allow** the new bot. Therefore, please navigate to the **Manage apps** screen:

# Adding Bot to a Group Chat

Within a Microsoft Teams conversation, sometimes a third person would be helpful for answering questions -- for example a virtual agent. In addition to direct chats with this assistant, Cognigy.AI provides group chats as well. After creating your app you can easily add it to a group chat as described below.

## Add the new Bot to a conversation

the new Microsoft Teams App (Virtual Agent) can be added to any conversation. Such as with other people in the organization, the **@ key** has to be used in order to tag the virtual agent. If it is the first time, one has to click the **Get bots** and **search** for the newly created bot, **click** it, and **install** it to the chat:

## Example conversation

In an internal use case, a personal chat with a colleague could involve the virtual agent for providing company-related information:

# Uploading Images via Teams

In some situations it might be necessary to upload an image via Teams for further processing. If you have activated image uploading your bot should have a "paper clip" below the text box which the user can click to upload files from their computer.

The image will be uploaded to the user's Sharepoint cloud and a download link will be automatically created in order to use the image in third party programs (such as RPA, ticketing systems etc.).

The image download URL can be found in the Cognigy input object under:

```
input.data.request.attachments[0].content.downloadUrl
```

### Endpoints & Channels

- [Azure Bot Services: Advanced Deployment with SSO (Microsoft Teams): SSO and Graph API Nodes](https://support.cognigy.com/hc/en-us/articles/6422300559388-Azure-Bot-Services-Advanced-Deployment-with-SSO-Microsoft-Teams-SSO-and-Graph-API-Nodes)
- [Azure Bot Services: Advanced Deployment with SSO (Microsoft Teams): Apps Developer Portal](https://support.cognigy.com/hc/en-us/articles/6422298661404-Azure-Bot-Services-Advanced-Deployment-with-SSO-Microsoft-Teams-Apps-Developer-Portal)
- [Azure Bot Services: Advanced Deployment with SSO (Microsoft Teams): Azure Portal](https://support.cognigy.com/hc/en-us/articles/6422296629404-Azure-Bot-Services-Advanced-Deployment-with-SSO-Microsoft-Teams-Azure-Portal)
- [Azure Bot Services: Advanced Deployment with SSO (Microsoft Teams): Azure Active Directory Portal](https://support.cognigy.com/hc/en-us/articles/6422293904540-Azure-Bot-Services-Advanced-Deployment-with-SSO-Microsoft-Teams-Azure-Active-Directory-Portal)
- [Azure Bot Services: Advanced Deployment with SSO (Microsoft Teams): Intro](https://support.cognigy.com/hc/en-us/articles/6417377133596-Azure-Bot-Services-Advanced-Deployment-with-SSO-Microsoft-Teams-Intro)  
- [Amazon Connect: Intro](https://support.cognigy.com/hc/en-us/articles/6229662732444-Amazon-Connect-Intro)  
- [Amazon Connect: Setup Amazon Connect](https://support.cognigy.com/hc/en-us/articles/6229664156060-Amazon-Connect-Setup-Amazon-Connect)  
- [Amazon Connect: Control Amazon Connect from Cognigy.AI](https://support.cognigy.com/hc/en-us/articles/6229683335196-Amazon-Connect-Control-Amazon-Connect-from-Cognigy-AI)  
- [Amazon Connect: Enable SSML replies from Cognigy.AI](https://support.cognigy.com/hc/en-us/articles/6229684421916-Amazon-Connect-Enable-SSML-replies-from-Cognigy-AI)  
- [Amazon Lex: Setup AWS Lambda (Amazon Lex NLU)](https://support.cognigy.com/hc/en-us/articles/6229644597020-Amazon-Lex-Setup-AWS-Lambda-Amazon-Lex-NLU)
