Automating Microsoft Service Status Reporting with Power Automate into Teams

Originally this thought came to mind after trying to create a way to notify support teams when there is an incident regarding Intune Service Status Health. Since we utilize Teams my thought process was to somehow figure out how to have reports sent to a channel and @mention a Team.

There are several different ways on how to accomplish this:

  • Manually forward or post report into Channel
  • Sign Up the Teams Channel email address for incident alerts in Office 365
  • Utilize Power Automate to Forward an Email

All of these methods work perfectly fine, but I wanted a way that is as close to fully automated as possible and ensure that the channel isn’t noisy with unimportant posts. So this led me to the following solution: personally sign up for Microsoft Alerts and utilize Power Automate to send an email with options to get approval to continue onto the workflow which will post to the Teams Channel. The Approval phase is the only manual part required to be able to decide if Alert gets posted to Teams Channel.

You can go about getting alerts from Microsoft by signing up with your email in the Report section of your Microsoft 365 Admin Center. From there I set up a rule in my mailbox to organize it a little bit further since I will be already be getting emails from Power Automate.

So I first started playing around with Flows after encountering Enhancing MEM end user experiences with Power Virtual Agents – Mobility, Management, & Security (uem4all.com). This solution was quite an exciting one and led to many new opportunities including this one.

The Flow can be set up fairly quickly but can be a good starting place for an automated alert solution.

The Flow starts with detecting when an email comes into your mailbox that meets the criteria to match the Microsoft Alert. This initial Trigger is important because it will be utilized to collect the variables needed for future actions.

Note: Remember to change the from field to Microsoft’s email address.

Once the trigger starts the flow a Send email with options action is started which sends a copy of the email body along with 2 options Approval & Reject. I spent quite a while playing around with the different options to send an Approval and a similar result can also be achieved using the built-in Approval action that plays well with Teams. I went with Send email with options because I ran into a few issues with displaying the Body of the alert email in the Approval, on the bright side doing it this way prevented me from getting multiple notifications(Teams notification & Email).

The Send email with options sends an email similar to the one below. It can be set up very simple and can be widely customized to include a variety of dynamic content from other actions.

Lastly, a condition is created that pulls the selectedOption variable from the Send email with options action. (Power Automate provides built-in dynamic content, in essence dynamic variables from each action and they have proven to be quite useful.) After you get the email and Approve, the Body of the email is posted into the Channel of the Team.

This solution does the trick for a simple Approval post but it has much potential for future additions. I will be posting future follow-ups improving this solution. A few potential upgrades to this solution are:

  • Finding a solution to @mention a channel. I tried to include the @mention a few ways and was successful but ran into an issue when trying to include the Microsoft Alert due to the content type of the email being application/ms-tnef
  • Adding the ability to add written text along with the approval
  • Add a way to modify the existing thread with an updated status so that there aren’t multiple posts

For those of you that utilize Jamf I am working on adding Jamf alerts to this workflow as well.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s