Configuring Microsoft Teams

This document provides detailed instructions for configuring Microsoft Teams in channels-connector

Prerequisites

  • Active Microsoft Azure account
  • Azure Active Directory Tenant
  • At least 1 user with Microsoft Teams license

Step 1: Create application

  1. Log in to Microsoft Azure Portal.
  2. Go to Active Azure Directory -> App Registrations and click New registrations.
  3. Create application with chosen Name and Supported account type.

Step 2: Configure application

  1. From App registrations section, choose newly created application.
  2. Go to API permissions and add following permissions from Microsoft Graph -> Delegated permissions:
    1. Chat.ReadWrite
    2. offline_access
    3. user.read
  1. Go to Certificates & secrets and create new client secret.
  1. Save secret's Value for later use.
  2. Go to Authentication and add a platform Web with Redirect URIs composed of admin application domain and channels/oauth/msteams endpoint.
  1. Make sure that Automate application has following configuration property:
    1. chatbots.admin.is-https: true

Step 3: Configure messages encryption

To secure connection from Microsoft Teams to channels-connector application, it is required to generate asymmetric key pair and use them in channels-connector configuration.

  1. Generate asymmetric key pair using OpenSSL in version 3.0+ by running following scripts on Linux machine.
  2. Private key
    openssl genrsa -out private.key 2048
    cat private.key | tail -n +2 | head -n -1 | tr -d \\n; echo
    
  3. Public key (certificate)
    openssl req -new -x509 -key private.key -out publickey.cer
    cat publickey.cer | base64
    

Step 4: Fill configuration file

chatbots.channels-connector.ms-teams: {
  enabled: true
  private-key: "FROM STEP 3"
  certificate: """FROM STEP 3"""
  client-secret: "FROM STEP 2"
  tenant-id: "FROM PREREQUISITES"
  client-id: "FROM STEP 2"
}

Tenant ID

Client ID

Step 5: Redeploy channels-connector with new configuration

Step 6: Authenticate Microsoft Teams account

  1. Log in to Automate platform.
  2. Go to Channels and click Create -> Microsoft Teams.
  3. You will be redirected to Microsoft's login page.
  4. Log in using credentials of user which will be used as bot and confirm permissions.
  5. New Microsoft's Teams channel will appear on channels list.