Skip to main content

Connect to Microsoft Teams

Microsoft Teams is a chat, meeting, and collaboration platform built into Microsoft 365. Connect Microsoft Teams to Retool to build internal tools that read and post channel and chat messages, manage teams and channels, and automate notifications.

What you can do with Microsoft Teams in Retool

After you create a Microsoft Teams resource in Retool, you can:

  • List teams and channels: Retrieve the teams, channels, and chats a user or app has access to.
  • Send messages: Post messages to channels and chats, including automated notifications from workflows and agents.
  • Manage channels: Create, update, and delete channels and manage channel membership.
  • Manage teams: Create teams and update team settings.
note

If you only need Teams messages, channels, and chats, this integration offers a simpler zero-configuration OAuth setup on Cloud instances. Use Microsoft Graph instead when you also need mail, calendar, user, or file data alongside Teams data in the same app, or when you need non-interactive authentication with Microsoft Azure Identity.

Before you begin

To connect Microsoft Teams to Retool, you need the following:

  • Microsoft 365 account: A Microsoft 365 account with access to the teams, channels, and chats you want to use in Retool.
  • Azure AD app (optional): A custom app registered in Azure Active Directory if you don't want to use Retool's hosted OAuth app.
  • Retool permissions: Ability to create and manage resources in your organization.

Create a Microsoft Teams resource

Follow these steps to create a Microsoft Teams resource in your Retool organization.

1. Create a new resource

In your Retool organization, navigate to Resources in the main navigation and click Create newResource. Search for Microsoft Teams and click the Microsoft Teams tile to begin configuration.

2. Configure general settings

Resource name and description

Specify a name and description for the resource that indicates which Microsoft 365 account or team it connects to. The description provides more context to users and Assist about how to use the resource.

Microsoft Teams resource configuration form.

Example nameExample description
Teams (Sales)Microsoft Teams connection for the sales team's channels and chats.
Teams (IT support)Microsoft Teams connection used to post automated alerts to the IT support channel.

3. Configure authentication

Microsoft Teams uses OAuth 2.0 to authenticate with Microsoft 365.

Cloud organizations can use Retool's hosted OAuth app or register a custom Azure AD app.

Option A: Retool's hosted OAuth app (Recommended)
  1. Under Scopes, select the Microsoft Graph permissions your use case needs, such as Channel.ReadBasic.All or ChannelMessage.Send. Retool preselects a set of commonly used scopes.
  2. Save the resource.
  3. Click Connect with OAuth and sign in with your Microsoft 365 account to grant the requested permissions.

Each user who accesses the resource authenticates with their own Microsoft account, unless you enable Share credentials between users.

Option B: Custom Azure AD app

Create an app in Azure Active Directory to connect Retool to Microsoft Teams.

  1. Copy the OAuth callback URL described in the resource configuration and add it as a redirect URI on your Azure AD app registration.
  2. Enter the Client ID and Client secret from your Azure AD app.
  3. Under Scopes, select the Microsoft Graph permissions your app registration is configured to request.
  4. Save the resource.
  5. Click Connect with OAuth and sign in to grant permissions.
Share credentials across users

Enable Share credentials between users to have every query run as a single authenticated Microsoft 365 account instead of each user authenticating individually. This is useful for automated workflows and agent tools that run without an interactive user present.

4. Configure advanced options

Outbound region

If your organization uses outbound regions, select the region that should be used for requests to Microsoft Teams. This controls which geographic region your requests originate from.

5. Verify the connection

Microsoft Teams resources don't include a Test connection button. To confirm your resource is configured correctly, connect with OAuth and check that Retool displays a Connected status, or save the resource and run a simple query, such as listing joined teams, to confirm access.

6. Save the resource

Click Create resource to save your Microsoft Teams resource. You can now use it in queries across your Retool apps, workflows, and agents.

Interact with Microsoft Teams data

Once you've created a Microsoft Teams resource, you can interact with Microsoft Teams data using Retool.

Switch to the new app builder

Retool recommends using the new app builder so you can use natural language to build React-based apps using AI.

Best practices

Follow these best practices to maintain the security of your Microsoft Teams resource.

  • Use least-privilege scopes: Only request the Microsoft Graph permissions your app or automation actually needs, rather than selecting broad scopes by default.
  • Rotate credentials regularly: Follow your organization's policy for rotating Azure AD app client secrets.
  • Use resource environments: Organizations on an Enterprise plan can configure multiple resource environments to maintain separate Azure AD apps for production, staging, and development.
  • Limit shared credentials: Only enable Share credentials between users when you specifically need requests to run as a single account, such as for scheduled workflows. Prefer per-user authentication for interactive apps.
  • Review app registrations periodically: Audit Azure AD app registrations and their granted permissions to remove access that's no longer needed.