Getting M365 Admin Center info with the Graph API

Published Aug 16 2021 11:33 AM 4,102 Views
Frequent Contributor

I wrote the original message center to Planner integration using the Office 365 Communications API, but this has now moved over to the Graph API, and the older API will no longer be available past the end of the year.  The built-in Message Center to Planner will have no issues of course, but if you used my code, or the additional Service Health Dashboard code I added a while back then you will need to update.  The code now fully uses MSAL for authentication and Graph to read both Message Center and Service Health Dashboard data.  It didn't need much changing, but I did notice that the MC posts now have a new reference type of 'Roadmap ID' which I am not using and it broke my code as I was only expecting an external link.  I just filter for the external links for now, but I'll likely come back and add Roadmap info and hopefully tie this into details from the M365 Roadmap too.

The code can be found at LunchWithaLens/AdminCenterAutomation: Updated code to use MSAL, as well as simplifying to loop on pr... and I won't walk-through it here as the basics haven't changed since the last walk-through blog post.

The code does two things:

  1. The original message center to Planner sync - not as convenient as the built-in code, but useful if you need to push into different plans or assign to various different people.  This writes a queue entry for each workload then another Azure function pulls these off and writes to Planner

Message Center to Planner syncMessage Center to Planner sync


      2.  Pushes service incident data into Teams, and will also @mention someone too.  Subsequent updates will add to the thread.

Teams view of a service incidentTeams view of a service incident

This code might also be useful just to see how to write into a teams channel and a thread and @ mention.

I might get around to porting these to C# at some point, and I really ought to tidy up the posts that have HTML formatting in them too!

1 Comment
Version history
Last update:
‎Aug 16 2021 11:33 AM
Updated by: