powershell
powershell copied to clipboard
[BUG] Invoke-PnPTenantTemplate : Teamify and HideTeamify operation is not supported in App-only context.
I created an Azure app registration with certificate by command "Register-PnPAzureADApp". I give my Azure app registration the API permissions "Sites.FullControl.All and Group.ReadWrite.All ". Now I try to provision a new MS Team with command "Invoke-PnPTenantTemplate". I do the authentication with the SharePoint Admin Center by clientId and certificate thumb and get the error
"Teamify and HideTeamify operation is not supported in App-only context.".
Expected behavior
I expect it should be possible to provision a new team in MS Teams by an Azure app registration without errors.
Actual behavior
I got the error:
Teamify and HideTeamify operation is not supported in App-only context.
Steps to reproduce behavior
$password = Read-Host -Prompt "Enter certificate password" -AsSecureString
Register-PnPAzureADApp -ApplicationName "AzureFunctionAppSP3" -Tenant myCompany.onmicrosoft.com -CertificatePassword $password -SharePointApplicationPermissions Sites.FullControl.All -GraphApplicationPermissions Group.ReadWrite.All -Interactive
Connect-PnPOnline -Url "https://myCompany-admin.sharepoint.com" -ClientId myClientIdGuid -Tenant 'myCompany.onmicrosoft.com' -Thumbprint myCertificateThumb
Invoke-PnPTenantTemplate -Path "C:\PS\template.xml"
What is the version of the Cmdlet module you are running?
2.2.0
Which operating system/environment are you running PnP PowerShell on?
- [X] Windows
- [ ] Linux
- [ ] MacOS
- [ ] Azure Cloud Shell
- [ ] Azure Functions
- [ ] Other : please specify