TechBuzzPro

How to Integrate Rasa with Microsoft Teams

· 6 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You can integrate Rasa with Microsoft Teams by registering a bot in Azure Bot Service, enabling the Microsoft Teams channel, and pointing the bot's messaging endpoint at your Rasa server's /webhooks/teams/webhook route. This lets Teams users chat with your Rasa assistant directly in channels and personal chats. The process needs a publicly reachable HTTPS endpoint for Rasa, an Azure account, and the Teams app manifest if you want a custom app listing. The steps below use the official Rasa Teams channel and Azure Bot Service; menu labels in Azure can differ slightly by portal version or region.

What You'll Need

  • A running Rasa server (Rasa Open Source or Rasa Pro) with a trained model and a credentials.yml file.
  • Python environment with Rasa installed, and the ability to restart the Rasa server.
  • An Azure account with permission to create an Azure Bot resource (or access to an existing one).
  • A public HTTPS URL that forwards to your Rasa server. For local testing, a tunneling tool such as ngrok works; for production, use a reverse proxy or cloud load balancer with a valid TLS certificate.
  • Microsoft Teams admin or app upload permission if you plan to distribute a custom app package.

Step-by-Step

  1. Enable the Teams channel in Rasa. Open your project's credentials.yml and add a teams section. The minimum configuration is:
    teams:
    app_id: "YOUR_MICROSOFT_APP_ID"
    app_password: "YOUR_MICROSOFT_APP_PASSWORD"

    Leave the placeholder values for now; you will fill them after creating the Azure Bot resource. Save the file.
  2. Start Rasa with the Teams channel loaded. Run rasa run --credentials credentials.yml --port 5005 (or your usual command). Confirm the server starts without credential errors. The Teams webhook route is exposed at /webhooks/teams/webhook.
  3. Expose Rasa over HTTPS. For local testing, start a tunnel to port 5005 and note the public HTTPS URL. For production, configure your reverse proxy or load balancer so that https://your-domain/webhooks/teams/webhook reaches the Rasa server. Teams requires HTTPS with a trusted certificate.
  4. Create an Azure Bot resource. In the Azure portal, create a new Azure Bot resource (search for "Azure Bot"). Choose the multi-tenant or single-tenant option that matches your organization, and note the Microsoft App ID generated for the bot. Create a client secret under the bot's configuration and copy the secret value; this is your app password. You will not be able to view the secret again after leaving the page.
  5. Set the messaging endpoint. In the Azure Bot resource, open the Configuration section and set the messaging endpoint to https://your-public-host/webhooks/teams/webhook. Save the change. This is the URL Azure uses to deliver Teams messages to Rasa.
  6. Add the Microsoft Teams channel. In the same Azure Bot resource, open the Channels section, select Microsoft Teams, and enable it. Accept the terms and save. The Teams channel should now show as running.
  7. Put the real credentials into Rasa. Replace the placeholders in credentials.yml with the Microsoft App ID and the client secret you created. Restart the Rasa server so the new values load.
  8. Test in Teams. In Teams, open the bot through the Azure Bot's "Test in Web Chat" first to confirm the endpoint responds, then use the Teams channel's option to open the bot in Teams, or install the bot in a team. Send a simple message and confirm Rasa replies.
  9. Package a custom Teams app (optional). If you want the bot listed as a custom app in your organization, create a Teams app manifest that references your bot's Microsoft App ID, package it as a zip with the manifest and icons, and upload it through the Teams admin center or the Teams app upload flow, depending on your permissions.

Common Mistakes

  • Using the wrong endpoint path. The messaging endpoint must point to /webhooks/teams/webhook, not the Rasa REST channel or the root URL.
  • Mismatched App ID or secret. The app_id and app_password in credentials.yml must match the Azure Bot resource exactly. A secret copied with trailing spaces will fail authentication.
  • HTTP instead of HTTPS. Teams will not deliver messages to an insecure endpoint. Self-signed certificates are also rejected in most setups.
  • Forgetting to restart Rasa. Changes to credentials.yml only take effect after the server restarts.
  • Using an expired client secret. Azure client secrets have an expiry. If the bot suddenly stops responding, check the secret's expiration date and create a new one.
  • Blocking the tunnel or firewall. If the public URL is not reachable from the internet, Azure cannot deliver messages and the bot appears silent.

Tips

  • Keep the Azure Bot resource and the Rasa credentials in the same tenant to avoid cross-tenant authentication issues.
  • Use environment variables or a secrets manager for app_password instead of committing it to source control.
  • Test with the Azure "Test in Web Chat" pane before involving Teams; it isolates endpoint problems from Teams-specific problems.
  • Log incoming requests on your reverse proxy so you can confirm whether Azure is reaching your server.
  • If you use Rasa Pro with an event broker, confirm the Teams channel is included in the channel list you run.

Troubleshooting

If the bot does not respond in Teams, work from the simplest checks outward. First confirm the Rasa server is running and that rasa run loaded the Teams credentials without errors. Next, open the Azure Bot resource and use the Test in Web Chat feature; if that also fails, the problem is between Azure and Rasa, not Teams. Verify the messaging endpoint URL is exactly https://your-host/webhooks/teams/webhook and that it is reachable from the public internet. Check that the client secret has not expired and that the App ID matches. If Azure shows delivery errors, inspect your reverse proxy logs for rejected requests, TLS errors, or 404 responses. A 401 or 403 usually points to a credential mismatch; a timeout usually points to a firewall or tunnel problem. If Web Chat works but Teams does not, confirm the Microsoft Teams channel is enabled in Azure and that the bot has been installed or opened in Teams. Finally, restart the Rasa server after any credential change and retest.

Frequently Asked Questions

Does Rasa support Microsoft Teams out of the box?

Yes. Rasa includes a Teams channel that you enable in credentials.yml and connect to an Azure Bot resource.

Can I test the integration without a public server?

You can use a tunneling service to expose your local Rasa server over HTTPS for testing. For production, use a proper HTTPS endpoint.

Why does the bot work in Web Chat but not in Teams?

Web Chat and Teams use different channels in Azure. Confirm the Microsoft Teams channel is enabled and that the bot is installed or opened in Teams.

Where do I find the App ID and password?

The App ID is shown on the Azure Bot resource overview. The password is the client secret you create under the bot's configuration; copy it when created because it is not shown again.

Do I need to publish the bot to the Teams app store?

No. For internal use, you can upload a custom app package or open the bot directly from Azure. Publishing to the public store is optional and requires additional review.

What happens when the client secret expires?

The bot stops authenticating and Teams messages fail. Create a new client secret in Azure, update credentials.yml, and restart Rasa.