Back to Spring Boot Admin

Microsoft Teams Notifications

spring-boot-admin-docs/src/site/docs/02-server/notifications/notifier-msteams.mdx

4.1.12.2 KB
Original Source

import metadata from "@sba/spring-boot-admin-server/target/classes/META-INF/spring-configuration-metadata.json"; import { PropertyTable } from "@sba/spring-boot-admin-docs/src/site/src/components/PropertyTable";

Microsoft Teams Notifications

To enable Microsoft Teams notifications, you need to set up a connector webhook url and set the appropriate configuration property.

<figure> ![msteams-notification.png](msteams-notification.png) <figcaption>Sample Microsoft Teams notification for a `STATUS_CHANGED` event</figcaption> </figure>

Message format

Notifications are sent as Adaptive Cards. The card body is composed of the title, the instance name, the text and a FactSet containing the instance's status and URLs.

SpEL expression context

The expression-based properties are parsed as SpEL template expressions (#{ ... }). The following root variables are available:

VariableTypeDescription
eventInstanceEventThe event that triggered the notification. Frequently used property: type (one of REGISTERED, DEREGISTERED, STATUS_CHANGED, REGISTRATION_UPDATED, INFO_CHANGED, ENDPOINTS_DETECTED). For STATUS_CHANGED events event.statusInfo.status holds the new status.
instanceInstanceThe full instance aggregate. Frequently used paths: instance.id (e.g. "TestAppId"), instance.registration.name (e.g. "Test App"), instance.statusInfo.status (one of UP, DOWN, OFFLINE, RESTRICTED, OUT_OF_SERVICE, UNKNOWN).
lastStatusStringThe previous status code of the instance (e.g. UP, DOWN, UNKNOWN), useful for building messages like from #{lastStatus} to #{event.statusInfo.status}.

<PropertyTable title="Microsoft Teams notifications configuration options" properties={metadata.properties} filter={['notify.ms-teams']} includeOnly={true} />