Extend Managed Team Templates with Microsoft Graph API

Team template capabilities were introduced to Microsoft Teams in the second half of 2020. Team templates enable organizations to have a common structure and needed apps on newly created teams, which helps users to see the familiar structure and discover information and conversations they need. An organization can also include certain needed apps, like bots to the team as well. Teams templates have been available on Microsoft Graph already for a couple of years, and they have been utilized on custom team provisioning solutions.

What is currently available?

When a user creates a new team with default Create a team functionality, he/she will be able to create it from scratch, clone from another team or pick a template from Microsoft pre-defined or organization’s custom templates.

Select a template

After picking a template, template contents are displayed. A template can contain channels, tabs, and apps.

Template settings

Administrators can create, edit and remove the organization’s custom templates and currently display Microsoft pre-defined templates on Teams Admin Center.

Manage templates

New templates can be created from scratch, from an existing team, or from an existing template. For a custom template administrators can add channels, tabs, and apps.

Template editor

Currently, Microsoft pre-defined templates cannot be removed or hidden from users, but the organization’s custom templates are added on top of the template picker.

Using Managed Template with Graph API

An organization might have a custom solution for managing team creation and templating. The template might be stored in a JSON format, which is quite difficult to manage. When template management capabilities are now available, the organization might want to move managing templates on Teams Admin Center. These templates can be included in custom provisioning solutions using Microsoft Graph API. The template is defined on template@odata.bind property, which by default is https://graph.microsoft.com/v1.0/teamsTemplates('standard').

{  "template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",  "displayName": "My Sample Team",  "description": "My Sample Team’s Description"}

When managed template is used with Graph API, standard is replaced with template ID.

{
  "template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('7c5f00d1-26f0-40d6-95b6-de0b9b4d7a22')",
  "displayName": "My Sample Team",
  "description": "My Sample Team’s Description"
}

Template ID for Microsoft pre-defined and custom templates can be found on template’s settings in Teams Admin Center.

Template ID

Modern approvals in Office 365 with Power Automate and Microsoft Teams
All Microsoft pre-defined template IDs can be also found from Docs: https://docs.microsoft.com/en-us/MicrosoftTeams/get-started-with-teams-templates

Extending Managed Template Capabilities with Graph API

Since currently managed templates only support channels, tabs, and app, there might be a need for extending template capabilities. Managed templates can be used with Graph API, and it is possible to extend template features on create team call just by using template JSON.

{
    "template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('9862a743-218e-46d9-8154-21c54f1ce265')",
    "displayName": "Project team demo",
    "description": "Project team demo",
    "memberSettings": {
        "allowCreateUpdateChannels": false,
        "allowDeleteChannels": false,
        "allowAddRemoveApps": false,
        "allowCreateUpdateRemoveTabs": false,
        "allowCreateUpdateRemoveConnectors": false
    }
}

Afterword

New team template capabilities are a good entry point to start building a unified structure for different types of teams. Quite commonly there is a request for controlling team settings, having approvals, or creating a custom app for team creation. New template management capabilities allow administrators to easily control template details, channels, tabs, and apps, and these templates can be used as a base template on custom provisioning solutions. It might be a good idea to mix and match template management on Teams Admin Center and using Graph API to extended missing capabilities. Currently, there isn’t any public API available for managing templates, which would help including managed templates as part of a custom provisioning solution. Admin controls, team template policies, are currently on the roadmap. With these policies, admins can control which templates are available for users.

Are there features replacing the need of custom provisioning solutions?
I would say no or it depends because organizations might have special needs for what happens during team creation. Some examples are approvals, provisioning documents and artifacts on SharePoint, creating resources like Planner plan, or OneNote or including a custom lifecycle management. Some important capabilities, like team settings, are also currently missing from managed templates.

Find more great blogs here

About the Author:

I have been working over 10 years with Microsoft technologies in several roles – developer, technical team lead, architect, consultant. Currently my focus is Microsoft 365 ecosystem, security, Microsoft Teams and SharePoint Online.

Reference:

Paukkonen, M. (2021). Extend Managed Team Templates with Microsoft Graph API. Available at: https://mattipaukkonen.com/2021/01/26/extend-managed-team-templates-with-microsoft-graph-api/

Share this on...

Rate this Post:

Share: