diff --git a/docs/platform/maintain/alerting/msteams.md b/docs/platform/maintain/alerting/msteams.md index a61927f5a..a7b0937c5 100644 --- a/docs/platform/maintain/alerting/msteams.md +++ b/docs/platform/maintain/alerting/msteams.md @@ -56,4 +56,32 @@ import Partial from "../../partials/\_editor-owner.mdx"; 6. Select the **SAVE** button. +## Troubleshoot Microsoft Teams alerting + +### Send a test alert to Microsoft Teams + +If you don't successfully receive alerts in Microsoft Teams, you can test the webhook by sending a webhook payload to the endpoint. Open a shell and enter this command. For `WEBHOOK_URL`, substitute the URL you copied in Microsoft Teams: + +```bash +curl -vH "Content-Type: application/json" -d '{ "type": "message", "attachments": [ { "contentType": "application/vnd.microsoft.card.adaptive", "contentUrl": null, "content": { "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.2", "body": [ { "type": "TextBlock", "text": "Hello World, this is a Mondoo Test!" } ] } } ] }' "WEBHOOK_URL" +``` + +### Error messages in Microsoft Power Automate + +When checking the event runs in [Power Automate](https://make.powerautomate.com/), you may see error messages like "The bot is not part of the conversation roster." This can occur if the channel to which you're trying to post Mondoo alerts is private. The Workflow app relies on a service principal (called Flow Bot) that is not allowed to join private channels. + +There are two solutions: + +- The simplest solution is to send Mondoo alerts to a public channel. + +- If you need to send Mondoo alerts to a private channel, you can change the Workflow flow to post alerts as a certain user: + + 1. Log into Microsoft Power Automate as the user you want to post Mondoo alerts. + + 2. In the left navigation, select **My flows**. + + 3. Open the flow you created in the [steps above](#create-a-webhook-in-microsoft-teams). + + 4. Change the last step in the flow (send adaptive card) to send the message as **User** instead of **Flow Bot**. + ---