Log data to Microsoft Teams

deviceTRUST can be used to send log data to a variety of services. Learn how Microsoft Teams can be used here!

deviceTRUST can use context information for a variety of purposes. In addition to reacting to certain information with matching controls, you might want to send data to some endpoint to have persistent logging or trigger ticket creation, for example. This article describes the integration of deviceTRUST with Microsoft Teams. You might want to use this approach for supporting your help desk with the required information


1. Teams channel selection: Chose to add a channel to Teams for this purpose or use an existing one. Make sure to have the information ready for step 2!


2. Setup a "web hook" in MS Teams: Data is being sent to MS Teams via REST technology. On the Teams side, a so called "Incoming Webhook" needs to be implemented for receiving the data. Please follow this Microsoft Technet article: Create an Incoming Webhook - Teams | Microsoft Docs 


3. Add the logging task to your deviceTRUST configuration: You'll find a "web request" task in the deviceTRUST console's action pane.

Select this type of task and fill information as required:

- URL: Your MS Teams Webhook's URL (from step 2)

- Headers: ContentType: application/json

- JSON body (example): 

{"@type"      : "MessageCard",
    "@context"  : "http://schema.org/extensions",
    "summary"   : "Security State %LOCAL_NAME%:%LOCAL_USER_NAME%",
    "themeColor" : "0078D7",
    "title"      : "Security State changed on %LOCAL_NAME%:%LOCAL_USER_NAME%",
    "text"       : "Security State:%CONTEXT_SECURITY_STATE%"

Note: This configuration uses the variable %LOCAL_NAME%, %LOCAL_USER_NAME% and %CONTEXT_SECURITY_STATE%, which are to be seen exemplarily. Edit as required.


This is how a fully configured web request task could look like. Find this configuration as blueprint in our GitHub Repository: Configurations/Universal at main · deviceTRUST/Configurations (github.com)

4. Check Teams for data being received and displayed: Configuring the web request task as shown above will send information to MS Teams looking like this:

You can, of course, always change the content, add information and personalize the data as required.