[BUG] Add-PnPTeamsTeam throwing Authentication Method is not allowed
Reporting an Issue or Missing Feature
I am using a certificate authentication method which is created using the Register-PnPAzureADApp with Connect-PnPOnline. When I try to user Add-PnPTeamsTeam with a modern team site is created using New-PnPSite -Type "TeamSite" -Title $siteTitle -Alias $groupAlias -IsPublic -Wait
I am getting Authentication method not allowed as shown [DBG]: PS C:\Projects\DOF-M365Provisioning> Add-PnPTeamsTeam Add-PnPTeamsTeam: {"odata.error":{"code":"10005","message":{"lang":"en-US","value":"Authentication method is not allowed."}}}
Expected behavior
I am expecting the Add-PnpTeamsTeam cmdlet to complete.
Steps to reproduce behavior
Connect-PnPOnline -URL "https://$($tenantName)-admin.sharepoint.com" -ClientId $appRegistrationClientIdValue -Thumbprint $certThumbprintValue -Tenant $tenantIdValue $tenantSite = New-PnPSite -Type "TeamSite" -Title $siteTitle -Alias $groupAlias -IsPublic -Wait $tenantSiteUrl = $($tenantSite.Url) Connect-PnPOnline -URL $tenantSiteUrl -ClientId $appRegistrationClientIdValue -Thumbprint $certThumbprintValue -Tenant $tenantIdValue Add-PnPTeamsTeam
What is the version of the Cmdlet module you are running?
PnP.Powershell 1.4.0
Which operating system/environment are you running PnP PowerShell on?
- [x] Windows
- [ ] Linux
- [ ] MacOS
- [ ] Azure Cloud Shell
- [ ] Azure Functions
- [ ] Other : please specify
@prawnz - This is a known issue for app-only context. You can use this command only with delegated permissions and user context due to limitations of SharePoint APIs.
If you wish you use app-only context, would suggest that you use
New-PnPMicrosoft365Group cmdlet and use -CreateTeam parameter. It does the same thing but uses Graph endpoints which support app-only scenarios.
@gautamdsheth all good.. will use your suggested method.
@gautamdsheth all good.. will use your suggested method.
When I try to use New-PnPMicrosoft365Group with the parameter -CreateTeam I get this error
Failed
Empty Payload. JSON content expected. (Empty Payload. JSON content expected.)
But the O365 group and teamsite is created correctly. I use the command in an Azure RunBook with the PnP PowerShell Version 1.4.0.
uuh sorry, an update to 1.5.0 solves the problem
I am facing the same issue with PnP.PowerShell version 1.5.0
I have added all the details in this issue