Skip to main content

MS Teams Bot development

Microsoft Teams is an entirely cloud-based product. Because of this, BotKube must be publicly accessible via an HTTPS endpoint.

For a local Kubernetes cluster, you can use the tunneling software, for example ngrok. It creates an externally addressable URL for a port you open locally on your machine.

Steps

  1. Install ngrok.
  2. Start ngrok:
    ngrok http 3978
  3. Install BotKube according to the MS Teams tutorial, but apply the following changes:
    1. Ignore the Prerequisites section and skip the Ingress controller installation.
    2. In the B. Deploy BotKube controller section, skip all parts related to the certificate and Ingress setup.
    3. In the Add a Bot to the App section, specify the base URL from step 2 for the Messaging Endpoint property. Use the following URL format: {ngrok_url}/bots/teams/v1/messages, for example, https://177b-37-30-104-55.eu.ngrok.io/bots/teams/v1/messages.
danger

If you stop and restart ngrok, the URL changes. In such a case, you need to update the Messaging Endpoint property and reinstall the bot into your Team.

  1. After BotKube installation, forward the local port to the Kubernetes BotKube Service:
    kubectl port-forward -n botkube svc/botkube 3978