The user can subscribe to either a project team or "regular" team (= we have two Teams template)

The user will be also the owner of the new team

The user may nominate other team owners and members when placing the request

If the user requests a private team, she/he must justify why this team has to be private (our example organization wants all communication to be transparent)

Private teams will be manually approved/rejected before they are created. Public teams are automatically created

And all of this without writing a single line of code!

Step 1 - Creating templates

We create two new teams (Template_Team and Template_Project) which will act as templates. Let's make the following changes to them.

Add typical channels

Delete Wiki site link for each channel (I just don't like them)

When we clone an existing team, we can pick (in REST API call) which part of the source team will be copied to the new team. Choices are

members

tabs

apps

settings

channels

Template owners are always copied to a new team. Don't be worried, they can be automatically removed during the process.

Step 2 - SharePoint list for the requests

We need a place where to store all team requests. SharePoint list is an excellent choice for that. Let's create a one with the following columns.

Title (name of the team)

Template id

Template name

Description

isPrivate

Comments for privacy (why this team should be private)

Owners

Members

Status

We need also another list having information about used team templates (name and id).

Wait a minute, where i can find those team id's?

You can always use Microsoft's excellent Graph Explorer. Sign in with your account and execute joined teamsquery. From the response, you find all the teams you have been joined (also those two templates we just created).

From there you can find also that team id we are looking for.

Step 3 - Order form (PowerApps)

How end users start the provisioning process? With PowerApps of course!

Just create an empty PowerApps and add the form on it. Attach the form to the SharePoint list we just created. After quick restructuring, our PowerApps looks like this.

I skip the details (this is not a PowerApps community) but after a few minutes of cleaning and building some logic to the form fields PowerApps looks like this.

If you are not familiar with PowerApps, don't stop here. You can skip PowerApps part and start with manually entering requests on the SharePoint list.

Let's make a few requests with PowerApps.

Seems to be working. Now we can start the hard part of this exercise.

Step 4 - Register Azure AD Application

We will use Microsft Graph API in our Flow for creating and updating teams. For that, we have to somehow authenticate our REST API calls. This can be easily done by using Azure AD Application.

The new team has the same owners than the team where it has been cloned from. We want to remove those ones.

Hardly comes as a surprise that this is done byREST API call to the Microsoft Graph.

Summary

Our solution can be used as a base for the provisioning solution. It can create different teams according to what the user has requested. It also can add owners and members of the created team.

Clone function is pretty handy. It makes easier to understand what templates actually looks like. An alternative way is to build the whole team from the scratch (add channels, change settings, add apps etc) in the Flow.

For example - How are you parsing the JSON? I see the first few lines but that does not give me all the steps to grab the GUID from the returned JSON.

After researching this a bit it looks like you ran the scripts one to generate the returned JSON then pasted that into the "Use Sample Payload to generate schema" which then allows you to parse the JSON that is returned more easily.

Parse JSON is super handy. First just run action that outputs JSON. Copy the output and give it to Parse JSON as an example (Use Sample Payload to generate schema). This works very well. If the JSON is very complicated, then you might like/have to write a schema by yourself.

After Parse JSON action you have all the output in arrays and/or variables. You can use them easily in your Flow,

Great article and I will be using it is a base for the solution I am developing. One request though. Would you be OK with exporting the flow and sharing? It would definitely speed up my development time if I got an actual flow example to import and work with.

I create MS Team using Custom Connector and flow, Authentication with MS Teams connector on Azure AD would require the global admin password to be fed in each time you log in, can you please tell me what i do that they do not ask again and again for global admin password.

We have managed to get Teams, channels and its settings to clone. however the tabs and apps are not showing for us (We are trying to use MS Planner in a tab). Did you manage to get yours to show and if you did, do you advise any sort of work around we could try?

We have tried changing permissions from app to delegate, tried using the planner api using the HTTP flow, however no luck.

It seems that when i add apps in the cloning part of the body it will produce the error and i cannot clone without adding the apps so i really dont know why its not working. Not even in graph explorer. Can it be something with my team template?

Nice that you solved the cloning issue! I am sorry if there were some beta endpoints used in my downloadable version of Flow. Beta is always beta and I had all kind of issues with beta endpoint. I had also issues with service level permissions. Delegated permissions worked at the time blog post was written much better.

If i create the Item i will be made into an Owner, if i then in the list as Owners also add myself it will conflict with the "Apply to each new owner" because im already added, this is logic. But in my situation this will happen alot from users and i wonder what i need to add to check if owner or members is already added skip and move forward in flow.

Thanks so much for the article. My company and I are trying to incorporate it for a client's environment and create a new Team whenever a custom entity record is created within a common data service app.

Right now I'm stuck on the parse JSON part. I'm not too experienced with Flow nor JSON so I'm wondering where to even start in regards to what I'm entering into that part.

Daniel is a Business Productivity Consultant & Microsoft Business Solutions MVP who is very enthusiastic about all things Office 365, Microsoft Flow, PowerApps, Azure & SharePoint (Online).
Since the preview, Daniel has been working with Microsoft Flow and later on with Microsoft PowerApps. That led to him being awarded an MVP Award for Business Solutions. He loves to blog, present and evangelize about improving productivity in the modern workspace with these amazing tools!

Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.