SharePoint PnP Get/Apply-SPOProvisioningTemplate Fails - Guid should contain 32 digits

New Contributor

Attempting to use the Microsoft Office Dev Patterns and Practices (PnP) Group "Remote Provisioning" toolset via PowerShell, specifically Get/Apply-SPOProvisioningTemplate on a fairly simple Team Site.


The latest error I am getting is related to the application of a template, and is complaining about a invalid GUID which the template extraction seems to have created (or left blank).


I am at a loss to find the source of the invalid GUID as the error output for the Apply-SPOTemplate is somewhat light on positional information. Is there a better way of determining the source line or section?


(trying to determine what scrubbing a copy of the .pnp file might need before I upload)


Exception : System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument, String failureArgumentName, Exception innerException) at System.Guid.TryParseGuidWithDashes(String guidString, GuidResult& result) at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result) at System.Guid.Parse(String input) at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectNavigation.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation) at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo) at SharePointPnP.PowerShell.Commands.Branding.ApplyProvisioningTemplate.ExecuteCmdlet() at SharePointPnP.PowerShell.Commands.SPOCmdlet.ProcessRecord()

3 Replies

Would it be possible to share the generated XML template?

Can you also run Set-SPOTraceLog to find out which part of your tempalte is causing problems:


then at least you will know which part is failing