[BUG] New-PnPTeamsTeam - 'PnP.PowerShell.Commands.Model.Graph.GraphException' was thrown.
Reporting an Issue or Missing Feature
When trying to use the command New-PnPTeamsTeam I receive the following error: New-PnPTeamsTeam -DisplayName "Test PnP Team" -MailNickName "TestPnPTeam"
New-PnPTeamsTeam: Exception of type 'PnP.PowerShell.Commands.Model.Graph.GraphException' was thrown.
I have tried using Connect-PnPOnline with the scopes parameter (Connect-PnPOnline -Scopes "Group.ReadWrite.All") and with clientId and ClientSecret (Connect-PnPOnline -ClientId $clientId -ClientSecret $clientSecret -AADDomain $tenant).
Expected behavior
New Team called Test PnP Team would be created in Teams with an email address of TestPnPTeam
Actual behavior

Steps to reproduce behavior
- Connect-PnPOnline -Scopes "Group.ReadWrite.All"
- New-PnPTeamsTeam -DisplayName "Test PnP Team" -MailNickName "TestPnPTeam"
What is the version of the Cmdlet module you are running?
PnP.PowerShell - 0.3.33
Which operating system/environment are you running PnP PowerShell on?
- [x ] Windows
- [ ] Linux
- [ ] MacOS
- [ ] Azure Cloud Shell
- [ ] Azure Functions
- [ ] Other : please specify
This occurs for me using 0.3.33 too - here are some further details:
It seems the Azure AD group is created but then the "Teamify" process fails so it does not create the Team

Here is the exception message

Message : Exception of type 'PnP.PowerShell.Commands.Model.Graph.GraphException' was thrown.
Stacktrace : at PnP.PowerShell.Commands.Utilities.REST.GraphHelper.SendMessageAsync(HttpClient httpClient, HttpRequestMessage message) in
D:\a\powershell\powershell\src\Commands\Utilities\REST\GraphHelper.cs:line 316
at PnP.PowerShell.Commands.Utilities.REST.GraphHelper.PutAsync[T](HttpClient httpClient, String url, T content, String accessToken) in
D:\a\powershell\powershell\src\Commands\Utilities\REST\GraphHelper.cs:line 281
at PnP.PowerShell.Commands.Utilities.TeamsUtility.NewTeamAsync(String accessToken, HttpClient httpClient, String groupId, String displayName, String description, String
classification, String mailNickname, String owner, GroupVisibility visibility, TeamCreationInformation teamCI) in
D:\a\powershell\powershell\src\Commands\Utilities\TeamsUtility.cs:line 140
at PnP.PowerShell.Commands.Graph.NewTeamsTeam.ExecuteCmdlet() in D:\a\powershell\powershell\src\Commands\Teams\NewTeamsTeam.cs:line 122
at PnP.PowerShell.Commands.Base.BasePSCmdlet.ProcessRecord() in D:\a\powershell\powershell\src\Commands\Base\BasePSCmdlet.cs:line 54
at System.Management.Automation.Cmdlet.DoProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
ScriptLineNumber : 1
My initial investigation shows that it seems to take suddenly longer for the underlying Microsoft 365 Group to be created fully. While the API immediately returns the group (which we then 'teamify'), doing the teamify task immediately after creating the group seems to throw this exception. We added a retry loop now to make sure we can teamify a group. We'll try 10 times and if then not succeeded we give up. For each iteration we wait 5 seconds to give the Graph the time to 'catch up'. This fix will be available in 0.3.35-nightly.