Skip to content

k-Jithesh/O365HealthMonitor

Repository files navigation

O365 Health Monitor

Updates : Health notification can now be sent to your mailbox https://docs.microsoft.com/en-us/microsoft-365/enterprise/view-service-health?view=o365-worldwide

#22/01/2021 Parametrised TimerSchedule - pass in Chron format. Eg. 0 */10 * * * * (for 10 minute frequency)

Parametrised TeamsWebhookPIRURL - to post PIR into teams channel. Can be same as TeamsWebhookURL

This sample Azure Function App, monitores for O365 service degradation and notifies to a Teams Channel.

--------------------

Application queries O365 service management API. https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-service-communications-api-reference writes the json to Azure blob. PowerBI Report can be used to visualise the information.

Setup Instructions.

  1. Create a new azure app registration, and create client secrets.
    1. Copy Domain Name, Client Id, Client Secret from the created app registration.
  2. Grant ServiceHealth.Read permission to the newly created applicaiton. Api Permission
  3. Create a new Storage account (general purpose v1) and copy the connection string (from under Access Keys).
  4. Create a Teams webhook to write notifications to Teams https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook
  5. Download the source code, build and publish the project to create a new Azure function app/or use existing function app.
  6. On the Newly created function app, provide/create the following application settings
    1. ClientId
    2. ClientSecret
    3. Domain
    4. TeamsWebhookURL
    5. TeamsWebhookPIRURL
    6. StorageConnectionString
    7. Env - Set to string other than Dev
    8. TimerSchedule

image

use Dev as Env application settings value only for execution from Visual Studio.
  1. Open O365HealthMonitor.pbix and modify the blob storage location strings. image

-- Powerbi Reports --

O365Health

-- Teams Notification --

TeamsNotification

-- Teams Notification PIR --

PIR