MS Teams

Along with the other channels, such as Facebook, WhatsApp and Google Business Messaging, logicdialog allows you to connect your digital assistant to a bot running inside Microsoft Teams. This guide will help you setup the connection and highlight anything you need to know in order to get this to work well.

Overview

To get the setup working from end-to-end there are a number of steps you'll need to complete. These are roughly as follows :

These steps assume that you have already created your workspace and have a digital assistant inside logicdialog. It also assumes that you are on an enterprise tier within Microsoft 365 and have the necessary credentials required to perform these tasks.

Creating an Azure Bot

From within the Azure portal home page, click Create a resource and search for Azure Bot in the resulting screen. You should be taken to a screen that looks like this :

When creating the bot, you'll be asked a number of questions including the name of the bot and the Resource Group. These will be specific to your installation, but you need to:

  1. Enter the bot handle name in the Bot handle field.

  2. Select your Subscription from the dropdown list.

  3. Select your Resource group from the dropdown list.

Remember to select the Type of App as Multi Tenant for Microsoft App ID.

Next, you will be taken to the validation screen. It can take a moment until validation passes, and when it is done, click Create.

When your deployment is completed, select Go to resource. The bot and the related resources are listed in the resource group.

Now your Azure bot is created and we can create client secret.

On the resulting screen, there will be a menu on the left called Configuration . Click on this and note down the Microsoft App Id as shown highlighted below.

While on this page, also click on the manage password link, next to the Microsoft App Id item. This will take you to another page where you can create a new password for this app ID.

Press the New Client Secret button.

The Add Client secret window appears. After providing a description and selecting Add button, copy the value that is in the Value column for the new entry created. Note this down along with the App Id from the earlier step.

Finally, we'll need one more bit of information. From the Azure portal, use the menu to select Azure Active Directory. The page should look something like the image below.

From this page, please copy the Tenant ID.

At this point you should have three bits of information copied down - The App Id, an App Secret and a Tenant ID.

Next, we'll also need to setup a clientId and clientSecret so that the application is able to retrieve the information about the user using the bot.

To generate a clientID :

  • Go to the home page of your Azure account.

  • Select Azure active directory in the left sidebar or home page Azur services list.

  • Click Enterprise applications in the left sidebar.

  • Click All applications in the left sidebar.

  • Select your application to look up the user details, i.e., their name/email address etc.

  • Click Properties.

  • Copy the Application ID. We'll refer to this as the clientId.

Once you've done this, you'll then need to generate a client secret.

  • Go to the home page of your Azure account.

  • Select Azure active directory in the left sidebar or home page Azur services list.

  • Click App registrations in the left sidebar and next choose All applications tab.

  • Select your application to look up the user details, i.e., their name/email address etc. The same one, which you selected when you have been creating clientId

  • Click on Certificates & secrets in the left sidebar.

  • Select the tab Client secrets and click New client secret.

  • After providing a description and selecting Add button, copy the value that is in the Value column for the new entry created. Note this down as clientSecret.

With this value created, you'll now need to grant this App registration permissions to be able to access the directory of users. To do this, click on the API Permissions menu and from there use the Add a permission button to find permissions to add. You'll need to ensure that Directory.Read.All is enabled, and granted the admin consent using the button shown.

Connecting the Azure Bot to Logicdialog

Now that you have the necessary information, we need to link the Azure bot, with your bot in logicdialog. Login to Logicdialog portal and go to the Settings page (to see this page you must have an admin role), from there choose Channels.

Find MS Teams card and click Connect.

Now you should see MS Teams Configuration modal. Add here your tenantId, appId, appPassword, clientId and clientSecret

Note down callback URL generated for you. This looks just like any other URL and will allow the Azure bot to send us information when the user enters anything or clicks on buttons within MS Teams. Save the changes.

Once you have this information, you will need to go back into the Azure portal and add this URL to the configuration of the Azure Bot. You'll find the setting under the Configuration menu. The field name is called Messaging endpoint.

After you've entered the webhook URL, press Save and then head over to the Test in WebChat page from the menu on the left. You should now see responses from your bot and you can interact with it and test that it is all working.

If the bot is working well here, then you are okay to move on to the next stage.

Creating an MS Teams Application

Once the link between Azure and logicdialog is tested and working properly, we need to package this integration up into an Application that others can use. We do this through the Developer Portal application, within MS Teams.

From the Apps tab of this application, create a new application and give it a name. A screen will appear, like the one below, providing a number of different configuration options.

You will need to complete various bits of information as part of this process. Some of those will be specific to your organisation - such as the name, description, avatar etc. With regards to the bot, go to the App features menu and select Bot . From here you'll be able to add the App Id of the bot we've created earlier. Ensure the Personal scope is selected.

After completing the necessary information, you can head back over to the Dashboard page to get a status of the application. This page should show no warnings or errors.

A button at the top right of the screen should allow you to Preview in Teams and allow you to test the bot as needed.

Distributing the Application

At this point you have an application that is connected to the bot, and has the necessary information in it to be able to be published to the store. Using the Developer Portal application, find the app and select the Publish to org page. A pop up window will appear giving you options to be able to add the Application to your organisation.

From there you should then be able to find the application via the normal Apps Catalog and start interacting with your bot.

Last updated