Teams Graph API in practice 2021 edition at ECS #CollabSummit

I hope you attended my session at European Collaboration Summit – ECS between friends – 2021 at Düsseldorf today! Even if you didn’t and you are interested about how you can use Graph API with Microsoft Teams to provision and manage teams then you may want to read forward.

It was quite a path that lead to this session finally to realize. When the Call for Speakers opened in 2019 for ECS 2020 I submitted a few sessions and the one with Graph API (named Building the Hub for Work: Teams Graph API in practice 2020 edition during those days ) was accepted. The session description is more or less the same with minor tweaks.

Join this session to see in demos how Teams Graph API can be used to create, manage and manipulate teams. Custom provisioning benefits from extended capabilities and it is also possible to customize new team further automatically than when using Team templates. During the session latest additions to the Teams Graph API are explored and audience can see in practice what will be possible and how the capabilities help organizations to get more out of team teams.
Graph API has a lots of potential to manage teams, in this session I will spark the inspiration and give you ideas how you could start working automated provisioning of your organization’s Teams.
2021 edition includes latest additions to Graph API and explores what is possible – with some fun experiments as well.

Yes, I welcome help with session titles and descriptions. 🤭😁 Perhaps I need to rename this session Managing the Metaverse with Teams Graph API for the future submits.

The core of this session is to inspire, ideate and show what you can do with Microsoft Teams Graph API when provisioning or managing teams. Power Automate (and Azure Logic Apps and so on) have plenty of actions for Teams and SharePoint available but they don’t offer the versatile options API does. There are certain actions where you may want to use Power Automate (or Azure Logic Apps) to manage actions because they can be very easy to implement and maintain – for example adding Planner tasks and writing welcome messages with atmentions. That is why I prefer to add those steps in the end: provision team and most of it’s structure, apps and so in using Graph API while performing post provisioning actions in a Power Automate. It is always best of both worlds – and you need to think how you manage and execute your solution as well.

This Graph API session was also the first one I did on a large stage. I had about 1000 rows of PowerShell running bits and pieces of Graph API in it. And that hasn’t changed: it is demo with PowerShell and Graph API. It allows me also to do minor changes during the session if I want to – like changing names. Recording demo videos isn’t that fun even those would be more reliable.

But the code I show is not an example showcase how you should write PowerShell. It is quite the opposite: meant to just demo and show what is possible (Proof of Concepting). With that many elements I don’t either spend much time with each element – it is mean to give inspiration and ideas what people could consider. I also use beta or unsupported calls there – which is the fun part.

Session is roughly level 300 – meaning that you need to have some understanding of PowerShell and Teams Graph API to be able to follow it. But you don’t have to: you can just enjoy the demos and gain understanding what is possible. I don’t explain each part in details – quite the opposite: the pace is fast and explains the overall what each step does.

Especially the NOT about part is important: do not use this code in production. It doesn’t have any tests nor it has not been written in best practice format. You can take the idea and see how calls are managed there.

Some calls require delegated permissions. In order to use them in your production you need to add portion where you do silent delegated authentication (as service account). In the session I use device login (thank you Lee Ford!) for delegated authentication token.

The point of this blog post is that I made the demo PowerShell script available (keep reading).

For those interested of session’s slides here they are:

List of demos included

  • Create team using Teams team template
  • Get Join link to the team
  • Update team settings
  • Provisioning email to General channel
  • Update team photo
  • Add applications
  • Remove Wikis
  • Copy template documents to the team
  • Attach copied word document to channel tab
  • Attach Document library to channel tab
  • Add existing tenant guest to the team
  • Create a Tag to team
  • Update channel moderation settings
  • Create private channel
  • Create and attach OneNote to team channel
  • Add content to OneNote
  • Attach a Dateaverse for Teams PowerApp to channel with custom parameter
  • Add empty Whiteboard to team channel
  • Attach existing Whiteboard to team channel
  • Attach SharePoint page to team channel
  • Create a SharePoint list
  • Attach the list to channel tab
  • Write into to provisioning list to start a Power Automate
  • Create a team in Migration mode and populate some messages there
  • Power Automate post provisioning actions

What are not included are

  • Example Power App nor it’s team apps
  • resource files or authentication information

In order to use the script you need to do some tweaking on those parts. Instead I recommend you take a look at those calls that interest you and utilize the idea and knowledge in your own scripts.

And yes, parts of those script are from 2019 but there are lots of new sections included.

Remember: Graph Explorer is your (only true) Friend!

Get the demo script from Github.

2 thoughts on “Teams Graph API in practice 2021 edition at ECS #CollabSummit

  1. Unfortunately I could not attend to your session. But this was the first thing I googled after coming home from Düsseldorf – ”vesa teams graph api”. Bingo! Here it was. Thank you very much for sharing your findings, demos and the blog post. Now I have nice time ahead of me digging into the demos and the presentation.


Leave a Reply

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

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

Twitter picture

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.