MS Teams
Learn about how to use MS Teams provider for chat notifications
The Novu Microsoft Teams integration enables you to send notifications to Teams channels and direct messages (DMs) across different customer workspaces using a single multi-tenant bot.
You create and host a Microsoft Teams bot in your Azure environment, and your customers then approve the app (via Admin Consent) and install it in their Teams tenants.
Once a customer connects their workspace, Novu establishes a secure channel connection using your bot's credentials. You then map specific destinations, whether the destinations involve public channels or individual users to channel endpoints, allowing Novu to route notifications dynamically to the correct tenant and conversation context.
Azure and Teams configuration
Before you can configure Novu, you must create the infrastructure that hosts your bot. This involves two distinct portals:
- Azure portal: To create the identity (App Registration) and infrastructure (Bot Service).
- Teams Developer Portal: To create the app package that your customers can install.
Create the app identity (Azure AD)
First, create a multi-tenant identity for your bot.
- Log in to the Azure Portal.
- In the menu, click Microsoft Entra ID (formerly Azure Active Directory).
- In the Manage section, click App registrations.
- To create an app, click New registration.

- Fill in the form:
- Name: Enter any name of your choice.
- Supported account types: Select Accounts in any organizational directory (Any Microsoft Entra ID directory - Multitenant).

- Click Register.

- After creating the app, note the Application (client) ID and Directory (tenant) ID. You need these values to configure Microsoft Teams in Novu.
Configure client secret
- On your new app's overview page, click Certificates & secrets.
- Click New client secret.

- Add a description.
- Set an expiry date.
- Click Add.

- Copy the value. This value becomes your
BOT_APP_SECRET, and you’ll paste it into Novu. You can view the secret only once right after you create it, so save it before you leave the page.
Add Novu’s redirect URI
After your customers go through the administrator consent page, Microsoft needs to know where to send them back after they accept.
- Click Authentication (Preview).
- Click Add Redirect URI.
- In the menu that appears, click Web.
- In the Redirect URI field, set the redirect URI to the Novu OAuth callback URL:
- US region
- EU region

- Click Configure.
Add Microsoft Graph app permissions
These permissions let your app list teams and channels and decide where to send messages.
- Click API permissions.
- Click Add a permission.
- Click Microsoft Graph.

- Click Application permissions.
- Search for and select the following permissions:
Team.ReadBasic.AllChannel.ReadBasic.AllAppCatalog.Read.AllTeamsAppInstallation.ReadWriteSelfForTeam.All(optional, for automation)TeamsAppInstallation.ReadWriteSelfForUser.All(optional, for automation)
- Click Add permissions.
Create an Azure Bot resource
Now you register your bot with the Azure AI Bot Service and link it to the app registration that you just created.
- In the Azure portal menu, click Create a resource.
- Search for “Azure Bot”, and then click the Azure Bot resource.

- Click Create.
- Fill in the basics:
- Bot handle: The unique display name in Azure.
- Subscription: Select the Azure subscription.
- Resource group: A collection of resources that share the same lifecycle, permissions, and policies, you can either select or create one.
- Data residency: Specify an option for data residency, either global or regional.
- Under Microsoft App ID:
- Type of app: Select Single-tenant app registration.
- Creation type: Choose “Use existing app registration” and use app IDs you created earlier:
- App ID: Replace with the Application (client) ID.
- App tenant ID: Replace with the Directory (tenant) ID.

- Click Review + create.
- Click Create.
Enable the Microsoft Teams channel
This connects your bot resource to Teams and lets your Teams app install cleanly.
- Once the deployment finishes, click Go to resource.

- Click Settings.
- Click Channels.
- In the available channelssection, click Microsoft Teams.
- In the menu that appears, accept the terms of services.
- In the Messaging section, choose the appropriate environment, typically Microsoft Teams Commercial.
- Click Apply.
Create a Teams app
Now you create the Teams “wrapper” around your app registration and bot.
- Open the Teams Developer Portal.
- Click Apps.
- Click + New app and then enter a name.
- Click Add.
- In the basic information page, fill in the required fields.
- Select App feature.
- Add a Bot and then select Enter a bot ID.
- Set the Bot ID to your
BOT_APP_ID, the same App ID you used for the Azure Bot. - Enable “What can your bot do?” to “Only send notification” as the least option.
- Enable scopes based on your use case:
teamfor channel messagespersonalfor DMs
You don’t need to edit the JSON yourself. The developer portal generates and checks it for you.
Publish the Teams app
Next, publish the app to a Teams store, if you want the app publicly available in the store. Publish to org if you want it accessible only inside your organization teams.
Refer to the Microsoft Teams documentation to learn how to:
Configure the Teams (Bot) integration in Novu
Now that you’ve configured your Azure Bot, provide Novu with the credentials to integrate it.
- Log in to the Novu dashboard.
- In the sidebar, click Integrations Store.
- Click Connect Provider.
- Select Chat and click MSTeams.
- Enter the credentials you saved from the Azure Portal:
- Client ID: Enter your
BOT_APP_ID. - Client Secret: Enter your
BOT_APP_SECRET. - App Tenant ID: Enter your
APP_TENANT_ID. This value identifies the tenant where you registered the app. - Redirect URL (Optional): If you want to control where your users land after they grant administrator consent, then enter that URL here. If you leave it empty, then the consent window closes automatically.

- Client ID: Enter your
- Click Create Integration.
Novu is now authenticated to act as your bot, but it still can't send messages because no customers have installed it.
Let your customers connect their tenant
Each of your customers has their own Microsoft 365 tenant. Before you can send them messages, they must grant your app a one time administrator consent. This authorizes your bot to act within their environment.
Generate a Connect Teams URL
On your backend, use the Novu SDK to generate the authorization URL. This URL is specific to the customer's tenant context in your system.
Novu returns a URL pointing to Microsoft's administrator consent endpoint. This URL already includes your Client ID, Redirect URI, and the necessary Graph scopes.
Show it in your UI
In your frontend app, bind this URL to a button:
What the customer administrator does
Steps the customer administrator would take:
- A Teams/Microsoft 365 Admin from your customer's organization logs into your product.
- They click your Connect Microsoft Teams button.
- They see a Microsoft consent page listing the permissions.
- They click Accept.
Once the user completes this step, Microsoft redirects the user back to Novu. Novu captures the customer's tenant ID and automatically creates a Teams connection for that specific tenant context. You don't need to handle the callback yourself.
Customer installs your app in their Teams
Granting Admin consent in the previous step only authorizes your bot to exist in the customer's tenant. It doesn't automatically add the bot to any specific teams or chats.
For the bot to send messages, install it in the specific context where notifications should appear:
- For channel messages: Install the app in the specific Team.
- For direct messages: Install the app for the specific user in their personal scope.
The customer’s administrator can install your app from the Teams app store or their org catalog, depending on how you published. If you requested the TeamsAppInstallation.ReadWriteSelfForTeam.All permission, your backend can programmatically install the app into a specific Team using the Microsoft Graph API.
Tell Novu where to send the messages
Your customer decides where notifications should land and gives you the right IDs and then your backend registers them as Channel Endpoints in Novu.
You can choose between two destination types:
- Channels: Send a message to a specific channel within a Team.
- Users: Send a direct message to a specific user.
Sending message to channels
To send a notification to a specific channel, you must discover the Team ID and Channel ID from Microsoft, and then register them in Novu.
Find the Team and Channel IDs (Microsoft Graph)
You can discover these IDs using the Microsoft Graph API. This requires an App-Only Token (Client credentials) scoped to the customer's tenant.
- Get a Graph access token:
The SUBSCRIBER_TENANT_ID represents the customer's tenant ID, which Novu stored on the ChannelConnection object after completing the Admin Consent flow.
- List Teams:
- List channels in a Team:
Register the channel endpoint (Novu)
Once you have the IDs, create an ms_teams_channel endpoint in Novu. This maps a subscriber to that specific channel.
Novu stores this as ChannelEndpoint<'ms_teams_channel'>. You can later target it from workflows via subscriberId + context.
Send a direct message to a user
To send a direct message (DM), you need the user's Teams User ID before registering the user endpoint in Novu.
Find the user ID (Bot framework)
Use the Bot framework API to inspect the roster of the Team where you installed the bot.
- Install the bot in at least one Team that includes the target user.
- Get a Bot Framework token:
- Call the roster API for that Team, using the Team’s
19:[email protected]id as{TEAM_CONVERSATION_ID}:
From the returned members, take the member’s id; this value represents the Teams user ID (29:...) you’ll use as userId.
Register the user endpoint (Novu)
Once you have the IDs, create the endpoint in Novu using the ms_teams_user type.
Novu stores this as ChannelEndpoint<'ms_teams_user'>. From here, any workflow that resolves to this endpoint can send a DM from your bot to that user.
Workflows for Teams (Webhook-style)
If you don't need a full Bot identity or Direct Message capabilities, then you can support a simplified, channel-only integration using Workflows for Microsoft Teams.
This approach relies on a unique Webhook URL generated by the Teams client. It requires no Azure app registration and no administrator consent.
User generates the webhook URL (Teams client)
The setup begins inside the Microsoft Teams app. Instruct your users to follow these steps:
- In Microsoft Teams, go to Apps in the sidebar.
- Search for and open Workflows.
- Click Create new flow, either from blank or template.
- Choose a trigger, such as “When a Teams webhook request is received”.
- Add an action to post a message into a specific channel.
- Save the workflow.
- Once created, the workflow generates a unique URL. The user must copy this URL.
Register the webhook endpoint (Novu)
Unlike the Bot integration, you don't use ms_teams_channel here. Instead, you treat this as a generic webhook endpoint. Your app should provide a form where the user can paste the URL they generated in the previous step.
Sending the notification
When you trigger a workflow that targets this subscriber:
- Novu sends a standard HTTP POST payload to the Teams Workflow URL.
- Workflows for Teams receives the payload.
- The Workflow runs and posts the message content into the configured channel.