
Announcements
Trying to combine the approaches for creating a team from a group:
https://learn.microsoft.com/en-us/graph/api/team-put-teams?view=graph-rest-1.0&tabs=http
and creating a team from scratch:
https://learn.microsoft.com/en-us/graph/api/team-post?view=graph-rest-1.0&tabs=http
to be able to create a team from a group, but set the Teams Template, and create a number of Tabs in the General channel.
I need to create the Group first, because I need the Shared Mailbox for the team to remain visible to email clients (and there does not seem to be anyway to set it to Visible after creating the team from scratch. This task seems possible in Power Shell and Azure Automations but not Power Automate.
Since the doco for converting a team to a group says the body of the request should be JSON representation of a Team and the examples of this used in the doco for creating the team from scratch (using POST) include Templates and Tabs (and I have been able to get these to work when creating the team from scratch, I was hopeful that I could include similar synax in the Body of the PUT.
I am using the Premium HTTP connector for this.
So as a relatively simple example, in POST the following works:
{
"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('@{variables('TeamTemplateID')}')",
"displayName": "@{variables('TeamShortName')}",
"description": "@{variables('TeamDescription')}",
"channels": [
{
"displayName": "General",
"isFavoriteByDefault": true,
"description": "This is the main channel for storing documents in the Files section",
"tabs": [
{
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",
"displayName": "Project eMail",
"configuration": {
"contentUrl": "https://outlook.office.com/mail/group/[URL Masked]/@{variables('TeamEmail')}/email/inbox"
}
},
{
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",
"displayName": "Project Register",
"configuration": {
"contentUrl": "https://[URL Masked]/DispForm.aspx?ID=@{variables('ProjectRegisterID')}"
}
},
{
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",
"displayName": "Opportunity Register",
"configuration": {
"contentUrl": "https://[URL Masked]/DispForm.aspx?ID=@{variables('OppRegisterID')}"
}
}
]
}
]
}
But this in PUT does not:
{
"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('@{variables('TeamTemplateID')}')",
"memberSettings": {
"allowCreatePrivateChannels": true,
"allowDeleteChannels":false,
"allowAddRemoveApps":true,
"allowCreateUpdateChannels": true
},
"guestSettings":{
"allowCreateUpdateChannels": false,
"allowDeleteChannels":false,
"allowAddRemoveApps":false
},
"messagingSettings": {
"allowUserEditMessages": true,
"allowUserDeleteMessages": true
},
"funSettings": {
"allowGiphy": true,
"giphyContentRating": "strict"
}
}
It seems that when ever I include @OData.bind lines in the body for the PUT method (used in converting the Group to a Team) I run into errors like this:
I have seen suggestions about adding @OData.type: null, and using two @'s but neither of these seem to work. Does anyone have any idea how to solve this?
As an alternative, I did try to use the Teams connector to do the Tabs, but that doesn't seem possible.
Its probably achievable to use the PUT to add Apps and Tabs, but it would be some much better for long term flexibility if what is in the template could be used when creating the Team from the Group.
Thanks for reading this far....
I think I may have found part of the answer at least here:
https://learn.microsoft.com/en-us/graph/teams-create-group-and-team
In this version they use a POST to the Teams end point, with this body:
{
"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('@{variables('TeamTemplateID')}')",
"group@odata.bind": "https://graph.microsoft.com/v1.0/groups('@{variables('TeamID')}')"
}
And doing this seems to work to invoke the template. Now on to tweaking the Tabs from the template and other myriad of things to get the team properly configured.