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​
- Install
ngrok
. - Start
ngrok
:ngrok http 3978
- Install Botkube according to the MS Teams tutorial, but apply the following changes:
- Ignore the Prerequisites section and skip the Ingress controller installation.
- In the B. Deploy Botkube controller section, skip all parts related to the certificate and Ingress setup.
- 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.
- After Botkube installation, forward the local port to the Kubernetes Botkube Service:
kubectl port-forward -n botkube svc/botkube 3978