Close Menu
Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    Facebook X (Twitter) Instagram
    Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    • Home
    • Intune
    • Windows
      • Modern Workplace
    • macOS
    • Android
    • iOS
    • Automation
      • Logic Apps
      • Intune Monitoring
      • GitHub
    • Security
      • Passwordless
      • Security
    • Speaking
    • About me
    Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    Home»Android»MEM Monitoring: Get Intune (or other Microsoft 365) Service Health messages in a Teams channel
    Android

    MEM Monitoring: Get Intune (or other Microsoft 365) Service Health messages in a Teams channel

    Peter KlapwijkBy Peter KlapwijkMay 26, 2021Updated:February 14, 202597 Mins Read

    Update January 2022: as the Office 365 Management API is deprecated and the new service communications API in Microsoft Graph replaces this legacy API, I did an update to this blog post.

    Microsoft PM Mark Hopper shared an article on Tech Community “Using Power Automate to notify admins on Intune Connector health“. I like this automation solution to get the connector health messages via Power Automate, but I changed the flow in our environment a little to post these messages in a Teams channel (instead of sending an email).

    So besides the Autopilot Deployment events which I described in a previous post, I now also have these connector health messages in Teams. What I also like to receive in Teams are the Intune Service Health messages. I know you can easily receive these messages via email when an incident is opened, via the Microsoft 365 portal, but to keep all these service health-related messages in one place I thought of creating a Logic Apps flow to pull these messages via an API from the health service and post these in a Teams channel.

    This blog post is part of the MEM (Intune) Monitoring series. An article with a short explanation of every MEM Monitoring flow I shared and links to the related articles can be found here.

    So again, I created a flow using Logic Apps to get this job done.

    The solution in short

    The complete Logic Apps flow which we’re going to create is shown below.

    The flow starts with a Recurrence trigger. It runs every hour. The first action is an HTTP action to query the Microsoft Graph API for the service communication issues. In the query, I use a filter to only retrieve the issues from the Microsoft Intune service. This action is followed by a Data operation, to select the values from the output of the HTTP action which I need in the following actions. To use this retrieved data in further actions, this data needs to get parsed.
    Next, a Condition is added to the flow. With this condition, I make sure only the issues are further processed which are modified in the last hour. If we don’t use this kind of filtering, every hour all pulled messages are posted to Teams, also the messages which are already been archived for some time. We finish the flow with another HTTP action to post a Teams messages via a Teams incoming webhook.

    Requirements

    We have some requirements for this flow.

    First of all, we need to have the appropriate permissions to run the API query. The HTTP action we use in the flow uses an Azure App Registration to authenticate to the Graph API. On this App Registration, we set the required permission we need for our API queries.

    This is an Application permission on Microsoft Graph. The required permission is ServiceHealth.Read.All.



    In this previous blog post, I described in detail how to create an App Registration.

    To post a message to a Teams channel we can use an Incoming Webhook. So make sure to add an incoming webhook to your Teams channel and save the webhook URL, to use it in one of the actions in our flow.

    To secure the HTTP actions I use an Azure Key Vault, which is described in this previous post, but this is optional (but recommended).

    The complete flow can also be downloaded from my GitHub repository and deployed using PowerShell/ Bicep.

    Setup the Logic Apps

    Sign-in to the Azure portal and open the Logic Apps service. Here create a new, blank Logic App.

    In the search box for connections and triggers search for Schedule. Select Schedule and select Recurrence which functions as our flow trigger.

    I choose to run this Logic Apps flow every hour.

    The first action we add is an Azure Key Vault action to retrieve the secret for authentication of the upcoming HTTP action. Search for Azure Key Vault and select Get secret.

    Enter at least the Vault name and click sign-in.

    Enter the name of the secret.

    Add a HTTP action.

    Add a HTTP action.
    As Method select GET.
    As URI enter:

    https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/issues?$filter=service%20eq%20'Microsoft%20Intune'

    Check Authentication and choose Active Directory OAuth as Authentication type. Enter the Tenant, Client ID (from the app registration), and Audience.
    And make sure to select the Key Vault secret value from the Key Vault action (found via Dynamic content).

    This is how our HTTP action looks like.

    We add a Data Operations action called Select.

    We use an expression to get the data from the value array of the HTTP output. Add below expression in the From field via the expression tab. Make sure to replace HTTP_ACTION_NAME with the name of your HTTP action, but with underscores instead of spaces.

    body('HTTP_ACTION_NAME')?['value']
    

    Next, enter all the key names on the left. You can choose the key names yourself.

    On the right, we need the values (items) from the previous HTTP action.
    To grab these items we use an expression like below:

    item()?['ITEMNAME']
    

    For example to get the Title:

    item()?['Title']

    These are the expressions I use in this example:

    item()?['Title']
    item()?['Id']
    item()?['impactDescription']
    item()?['Classification']
    item()?['startDateTime']
    item()?['lastModifiedDateTime']
    item()?['Status']
    item()?['isResolved']

    When you use this for all or multiple workloads, you might want to add Service as well.

    Enter all the expressions one by one.



    This is the complete Select action.



    Save the Logic App and run the flow.
    When it’s finished open the flow from the Runs history and open the Select action.
    Copy the Outputs body. We use this as a sample payload in the next action.

    Switch back to the designer.
    Add a Parse JSON action to the flow, which is a Data Operation action.
    As content, we use the Output from the previous Select action.
    We fill the schema by using the sample payload we just copied in the previous step. Click Use sample payload to generate the schema and paste the copied data in the box which will generate the schema.

    Next, we add a Condition, which is a Control action. With this condition, we filter out all the older messages, which didn’t get an update in the last hour (based on the Last Updated Time value).

    As a value add Last Modified Date Time. Choose is greater than from the drop-down box. In the right value box, we enter an expression to add the current time (UTC) minus 1 hour.
    The expression is addHours(utcNow(),-1)

    As soon as we add LastUpdatedTime to the Condition, the action is automatically placed in a For each action.



    Let’s go further with the required actions:
    Under True, we enter an HTTP action.

    As Method select POST.
    As URI enter the webhook URL.
    As Headers enter Content-Type – application/json

    In the body, we add the text and title in JSON format. Below is the JSON format we need to use for this, without our variables:

    {
     "text": "WRITE YOUR MESSAGE TEXT HERE",
      "title": "WRITE YOUR TITLE HERE"
    }

    We can use dynamic content (variables) from the previous PARSE JSON action and enter our own text.
    Use \n\n in the text to create new lines in the text message, otherwise, the message consists of one long line of text.
    And I used ** to get some text in bold.

    This is the body from my above example:

    {
      "text": "**Title:** @{items('For_each')['Title']}\n\n **ID:** @{items('For_each')['ID']}\n\n **Impact Description:** @{items('For_each')['Impact Description']}\n\n **Classification:** @{items('For_each')['Classification']}\n\n **Start Time:** @{items('For_each')['Start Date Time']}\n\n **Last Modified Time:** @{items('For_each')['Last Modified Time']}\n\n **Status:** @{items('For_each')['Status']}\n\n **Is Resolved:** @{items('For_each')['Is Resolved']}",
      "title": "@{items('For_each')['ID']} "
    }

    This is our complete Logic App flow to get the job done.

    The end result

    This flow should post a message when an incident is added to the Service Health Dashboard based on the service degradation status.
    And it should post a message when the service is restored.

    This Logic App flow could of course also be used to get all Microsoft 365 Service Health messages in a Teams channel by removing the filter in the HTTP GET action. Or change the filter if you’re interested in another workload.

    Thanks for reading and leave a comment when you have a question or have suggestions for this flow.

    Android Flow Graph Graph API Intune Intune Monitoring iOS Logic Apps macOS MEM MEMMonitoring Microsoft Endpoint Manager Power Automate PowerApps Windows 10
    Share. Facebook Twitter LinkedIn Email WhatsApp
    Peter Klapwijk
    • Website
    • X (Twitter)
    • LinkedIn

    Peter is a Security (Intune) MVP since 2020 and is working as Modern Workplace Engineer at Wortell in The Netherlands. He has more than 15 years of experience in IT, with a strong focus on Microsoft technologies like Microsoft Intune, Windows, and (low-code) automation.

    Related Posts

    MEM Monitoring: Get notified on Intune Configuration profile changes

    August 2, 2021

    Export Endpoint Analytics Proactive remediation data with Logic Apps

    April 19, 2021

    Export Edge favorites to use in an Intune profile or GPO

    April 9, 2021
    View 9 Comments

    9 Comments

    1. Bob on January 28, 2022 15:16

      What would the cost of this be monthly?

      Reply
      • Peter Klapwijk on January 28, 2022 15:24

        I have a few Logic Apps running which cost me a whole Dollar 🙂

        Reply
    2. MAYUR ARVIND MAKWANA on March 10, 2022 15:24

      Hello Peter, Great Stuff,

      when i run the above i get the error “ValidationFailed. The schema validation failed.” at the Parse JSOnN step. Any inputs will be appreciated. thanks

      Reply
      • MAYUR ARVIND MAKWANA on March 10, 2022 17:03

        Sorry to bother, the above works had some typo.

        Reply
    3. Patrick on May 1, 2023 11:09

      Hey Peter, is this also achievable with Power Automate?

      Reply
      • Peter Klapwijk on November 8, 2023 17:48

        Hi Patrick,

        Sorry I missed your message.
        It is achievable with PowerAutomate.

        Reply
    4. Joe on November 8, 2023 17:04

      Hi, I did everything correct but for some reason the addHours(utcNow(),-1) is returning false but there is data there. The flow does fire off hourly but does not email anything with that expression.

      Reply
      • Joe on November 8, 2023 17:06

        disregard

        Reply
      • Peter Klapwijk on November 8, 2023 17:54

        Hi Joe,

        When no messages are posted/ modified in the last hour, no mail will be sent.
        To test, change hours in days an play around with the number to process older messages.

        Reply
    Leave A Reply Cancel Reply

    Peter Klapwijk

    Hi! Welcome to my blog post.
    I hope you enjoy reading my articles.

    Hit the About Me button to get in contact with me or leave a comment.

    Awards
    Sponsor
    Latest Posts

    Hide the “Turn on an ad privacy feature” pop-up in Chrome with Microsoft Intune

    April 19, 2025

    How to set Google as default search provider with Microsoft Intune

    April 18, 2025

    Using Windows Autopilot device preparation with Windows 365 Frontline shared cloud PCs

    April 13, 2025

    Using Visual Studio with Microsoft Endpoint Privilege Management, some notes

    April 8, 2025
    follow me
    • Twitter 4.8K
    • LinkedIn 6.1K
    • YouTube
    Tags
    Administrative Templates Android Automation Autopilot Azure Azure AD Browser Conditional Access Edge EMS Exchange Online Feitian FIDO2 Flow Google Chrome Graph Graph API Identity Management Intune Intune Monitoring iOS KIOSK Logic Apps macOS MEM MEMMonitoring Microsoft 365 Microsoft Edge Microsoft Endpoint Manager Modern Workplace Office 365 OneDrive for Business Outlook Passwordless PowerApps Power Automate Security SharePoint Online Teams Windows Windows 10 Windows10 Windows 11 Windows Autopilot Windows Update
    Copy right

    This information is provided “AS IS” with no warranties, confers no rights and is not supported by the authors, or In The Cloud 24-7.

     

    Copyright © 2025 by In The Cloud 24-7/ Peter Klapwijk. All rights reserved, No part of the information on this web site may be reproduced or posted in any form or by any means without the prior written permission of the publisher.

    Shorthand; Don’t pass off my work as yours, it’s not nice.

    Recent Comments
    • Peter Klapwijk on Using Windows Autopilot device preparation with Windows 365 Frontline shared cloud PCs
    • John M on Using Windows Autopilot device preparation with Windows 365 Frontline shared cloud PCs
    • Christoffer Jakobsen on Connect to Azure file shares with Microsoft Entra Private Access
    • Ludo on How to block Bluetooth file transfer with Microsoft Intune
    • RCharles on Automatically configure the time zone (during Autopilot enrollment)
    most popular

    Application installation issues; Download pending

    October 1, 2024

    Restrict which users can logon into a Windows 10 device with Microsoft Intune

    April 11, 2020

    How to change the Windows 11 language with Intune

    November 11, 2022

    Update Microsoft Edge during Windows Autopilot enrollments

    July 9, 2024
    Peter Klapwijk – In The Cloud 24-7
    X (Twitter) LinkedIn YouTube RSS
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.

    Manage Cookie Consent
    To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
    Functional Always active
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
    View preferences
    {title} {title} {title}