Skip to main content

Microsoft Teams Integration

Before we describe mechanics of making Microsoft Teams work with your chatbot, let us first look at the diagram below showing how communication with MS Teams happens.

img alt

Azure Bot (8) replaces Channel connector service (5) when it comes to handling the channel MS Teams and also some of the other channels like Skype, Slack, Facebook Messenger, Telegram etc. Azure Bot is a resource that can only be deployed in Microsoft Azure. It handles communication between chatbot web service and these chat channels. As AI Studio can handle communication between web chat-channel and chatbot web service through Channel connector service, you can potentially have complete on-premise deployment of the solution when the only channel that needs to be supported is web-chat. You will need a Microsoft Azure subscription to create an 'Azure Bot' resource. Azure Bot resource is free of cost when used with MS Teams.

Ngrok Setup

Follow the steps explained in Ngrok Setup. When you specify 'Messaging Endpoint' in the 'Azure Bot' resource you will use the <NGROK https end-point>/api/messages

Create an Azure Bot Resource

This video shows you all the steps necessary to create an Azure Bot resource and integrate it with your chatbot web service.

Cognibot Web Service Configuration Changes

As you saw in the video, after you have created the Azure Bot resource in Azure and configured its Messaging endpoint to https://<NGROK https end-point>/api/messages, you will have make changes to the following four settings in .env file found the cognibot directory. Default values of these three settings are shown below.

WEBCHAT_CH_REG=True
APP_ID=<Azure Bot resource App ID>
APP_PASSWORD=<Azure Bot resource password>
CHATBOT_URL=<NGROK https end-point>/api/reply

You will have to change value of WEBCHAT_CH_REG from True to False which tells the cognibot web service not to use Channel connector service but to use Azure Bot service and put correct values of APP_ID and APP_PASSWORD which you would have obtained as explained in the video. Finall, change the value for CHATBOT_URL to https://<NGROK https end-point>/api/reply. After changing these settings in the .env file, you will have to restart the cognibot web service. Please note, if you have already run ngrok http 3978 i.e., ngrok is already running, users should not restart it else it will result into changing the public http and https endpoint.