I can't seem to find anything on this specific error. I first create a group that only has an owner, then add a team to the group, which fails. This was executing successfully the other day, so I'm not sure what's going on.
Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/amer/templates/api/group
s/(group ID)/team, Request Method: PUT, Response Status Code: NotFound, Response Headers: Strict-Transport-Security: max-age=25920
00
x-operationid: 4891d546ce7d4cc1b7628971535f4589
x-telemetryid: 00-4891d546ce7d4cc1b7628971535f4589-f648563539f19266-01
X-MSEdge-Ref: Ref A: C77457E24A6040CF833842B3D48AEA55 Ref B: CH1AA2020613029 Ref C: 2023-04-28T16:38:14Z
Date: Fri, 28 Apr 2023 16:38:14 GMT
, ErrorMessage : {"errors":[{"message":**"Failed to execute GetGroupMembersMezzoCountAsync."**,"errorCode":"Unknown"}],"operationId":"4891d546ce7d4cc1b762897153
5f4589"}
Code to add team to group:
$NewTeamParams = @{
"template@odata.bind"="https://graph.microsoft.com/v1.0/teamsTemplates('standard')"
"group@odata.bind"="https://graph.microsoft.com/v1.0/groups('$($Group.Id)')"
}
New-MgTeam -BodyParameter $NewTeamParams -ErrorAction Stop
The group ID is from this script, which executes successfully:
$GroupOwner = (Get-MgUser -UserId $GroupOwnerEmail).Id
$Owner = "https://graph.microsoft.com/v1.0/users/" + $GroupOwner
$NewGroupParams = @{
"displayName" = $TeamName
"mailNickname"= $TeamMail
"description" = $TeamDesc
"owners@odata.bind" = @($Owner)
"groupTypes" = @(
"Unified"
)
"mailEnabled" = "true"
"securityEnabled" = "true"
"assignedLabels" = @(
@{"LabelId"=$SensitivityLabelId}
)
}
$Group = New-MgGroup -BodyParameter $NewGroupParams -ErrorAction Stop
I had this working the other day. I am not sure what else to try.