1

Microsoft Teams Tutorial

Table of contents
  1. Microsoft Teams Tutorial
    1. Create a Teams Developer Account
    2. Create a Bot
    3. ngrok Port Forwarding
    4. Configuring the Bot
    5. Create an App Manifest on The Teams Developer Portal
    6. Add The App To Your Teams Installation
    7. Configure Your App On Teams
    8. Configuring application.yml
      1. tennantId
      2. MicrosoftAppId
      3. MicrosoftAppPassword
      4. Storage Account
      5. Start the bot
    9. Talk With Your Bot

This is a short guide on how to get started with Microsoft Teams. It is a bit of a minefield, but once you have your bot talking to the Spring Bot app, things are easy. Hopefully this will give some clues as to how to get there.

Create a Teams Developer Account

You can apply for a 90-day developer account that allows you to set up an instance of Microsoft Teams with up to 20 different users. This allows you to work with colleagues to build and test a bot.

Developer Program

Accounts

Login

Create a Bot

New Bot Screen

Bot App Id

ngrok Port Forwarding

Since your bot is running on localhost, Microsoft Teams can’t access it. However, we can use ngrok to tunnel onto the public internet, running in HTTPS with a proper certificate. From there, we can get Microsoft Teams to talk to it.

ngrok http 8080

ngrok

Configuring the Bot

Bot Endpoint

Bot Secret

Create an App Manifest on The Teams Developer Portal

We are going to create an App, which is something that is available in the Teams App Store, and can be installed into your Teams chats. An App can contain a number of bots. Here, we’ll just create one.

Create App

App Features

Identify Bot

Identify Bot

Teams Perms

Download App

Add The App To Your Teams Installation

Before you can see the App in the Teams App Store, it needs to be approved (published) by your Teams administrators.

The Admin Console has a “Manage Apps” section here.

Upload App

Moving App To Published

Configure Your App On Teams

Now, we’re going to create a chat on Teams and add the App to it.

New Chat

App Store

Adding The App 1

Adding The App 2

Configuring application.yml

Your bot will need an application.yml file containing the details of your teams installation:

teams:
  app:
    tennantId: 
  bot:
    MicrosoftAppId: 
    MicrosoftAppPassword: 
  storage:
    type: blob
    connection-string: 
    
spring:
  profiles:
    active: teams  # put teams, symphony if you want both

Let’s go through these settings in turn:

tennantId

Here I am getting the Tennant ID from my Teams Instance. This is from the Azure Admin Portal TennantID

MicrosoftAppId

This is the bot’s AppId, which you can get from the Teams Developer Console:

Bot App Id

MicrosoftAppPassword

This is the bot client secret, that you generated earlier on.

Storage Account

Unlike Symphony, Teams cannot store app-data inside chat messages, so we need to set up a separate Azure Blob storage.
This allows the bot to keep track of the messages it has sent, and the conversations it is involved in.

New Blob Storage

Created Blob Storage

Access Key

Start the bot

Spring Startup

Talk With Your Bot

For example, try asking your bot for help:

Talk To The Bot

From then on, you can follow one of the other tutorials for building a bot with custom functionality.