Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
22.5k Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Send Microsoft Teams Notification on Alarm

Configure ThingsBoard to automatically send notifications to Microsoft Teams when an alarm is created. This guide extends the Create and Clear Alarms recipe by using the Notification Center to deliver alarm-based messages to a Teams channel via a webhook.

Assume your refrigeration equipment has a temperature sensor that periodically publishes telemetry to ThingsBoard. The normal operating range is 2 °C – 5 °C. When a reading goes outside this range:

  • An alarm is created by the alarm rules.
  • A message is sent to the configured Microsoft Teams channel.

Before proceeding:

Review the following documentation for background:

The Notification Center delivers notifications to users. It consists of three components:

  • Recipients — define who receives notifications.
  • Templates — define the notification content and delivery method.
  • Rules — define the conditions under which notifications are sent.

Create a recipient that posts to the Microsoft Teams channel via the webhook URL.

  1. Navigate to Monitor ⇾ Notifications ⇾ Recipients.
  2. Click + Add recipients in the top-right corner.
  3. Configure the recipient:
    • Name: Microsoft Teams
    • Type: Microsoft Teams
    • Webhook URL: paste the webhook URL copied from Teams
    • Channel type: specify Microsoft Teams channel
  4. Click Add.

Create a template that defines the Teams message subject and body using alarm variables.

  1. Navigate to Monitor ⇾ Notifications ⇾ Templates.
  2. Click + Add template in the top-right corner.
  3. Setup — configure the template:
    • Name: Alarm notifications to Microsoft Teams
    • Type: Alarm
    • Delivery methods: toggle Microsoft Teams on
  4. Click Next.
  5. Compose — expand the Microsoft Teams section and set:
    • Subject:
      ${alarmType} on ${alarmOriginatorName} device
    • Message:
      A ${alarmType} has been detected on the ${alarmOriginatorName} device: ${details.data} °C.
  6. Click Add.

Template variables used:

  • ${alarmType} — the alarm type name (e.g. High temperature).
  • ${alarmOriginatorName} — the name of the device that triggered the alarm.
  • ${details.data} — the reported telemetry value, populated by the alarm rule.

Create a rule that links the alarm trigger to the template and recipient.

  1. Navigate to Monitor ⇾ Notifications ⇾ Rules.
  2. Click + Add rule in the top-right corner.
  3. Basic settings — configure the rule:
  4. Click Next.
  5. Alarm trigger settings — configure the filter:
    • Alarm type list: Any type
    • Alarm severity list: Any severity
    • Notify on: Alarm created
  6. Click Add.

Publish a temperature value that triggers the alarm (above 5 °C).
Use the Check Connectivity feature or the command below:

Terminal window
curl -v -X POST \
--header "Content-Type: application/json" \
--data '{"temperature": 25}' \
http://thingsboard.cloud/api/v1/$ACCESS_TOKEN/telemetry

A new alarm is created and a message is posted to the configured Teams channel. The subject and body are populated from the template variables — for example: “A High temperature has been detected on the Thermostat device: 25 °C.”