pnp / PnP-Provisioning-Schema

Office 365 Patterns and Practices - Remote Provisioning Schema
MIT License
161 stars 220 forks source link

Provisioning Teams site and Teams #590

Open SPLeon opened 1 year ago

SPLeon commented 1 year ago

Hi there,

I just started with the PnP Provisioning schema. For a customer I need to built a template which contains a site collection and a team (which is obviously connected to this site).

It's necessary to run it without a logged in user as we gonna move it to Azure DevOps. So I created an app registration with a certificate and Api permissions:

The site is created but it stops with an exception. The site is however created with wrong settings (language incorrect, no additional owners, etc.) The error (Get-PnPException):

Object reference not set to an instance of an object. Stacktrace : at PnP.Framework.Graph.UnifiedGroupsUtility.d5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at PnP.Framework.Graph.UnifiedGroupsUtility.<>cDisplayClass19_0.<b0>d .MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at PnP.Framework.Graph.UnifiedGroupsUtility.AddUnifiedGroupMembers(String groupId, String[] membe rs, String accessToken, Boolean removeExistingMembers, Int32 retryCount, Int32 delay, AzureEnvironme nt azureEnvironment) at PnP.Framework.Sites.SiteCollection.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at PnP.Framework.Sites.SiteCollection.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at PnP.Framework.Provisioning.ObjectHandlers.ObjectHierarchySequenceSites.ProvisionObjects(Tenant tenant, ProvisioningHierarchy hierarchy, String sequenceId, TokenParser tokenParser, ApplyConfigura tion configuration) at PnP.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyTenantTemplate(Tenant tenant, ProvisioningHierarchy hierarchy, String sequenceId, ApplyConfiguration configuration) at PnP.PowerShell.Commands.Provisioning.Tenant.InvokeTenantTemplate.ExecuteCmdlet() at PnP.PowerShell.Commands.PnPSharePointCmdlet.ProcessRecord()

I already did come investigation. Here are some findings:

I personally think is had something to do with the Graph Api, but I cannot find anything.

The template (I removed the parameters and header of the file as its not relevant)

`

`
glasserre-pdw commented 1 year ago

Have the same issue. If a run the command a second time, the provisioning start correclty.