The Provisioning Template URI HumaxTemplate1.xml

%3CLINGO-SUB%20id%3D%22lingo-sub-81377%22%20slang%3D%22en-US%22%3EThe%20Provisioning%20Template%20URI%20HumaxTemplate1.xml%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-81377%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20connect%20to%20our%20customer%20tenant%20and%20get%20a%20.pnp%20file%20without%20errors%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%24tenant%20%3D%20%22ourcustomertenant%22%3B%0A%24sourceSite%20%3D%20%22%2Fsites%2FClientesNotaCredito%22%3B%0A%24webUrl%20%3D%20%22https%3A%2F%2F%7B0%7D.sharepoint.com%7B1%7D%2F%22%20-f%20%24tenant%2C%20%24sourceSite%3B%0A%24path%20%3D%20%22C%3A%5CTemplates%5CHumaxTemplate.pnp%22%0AWrite-Output%20%24(%22Connecting%20to%20%7B0%7D...%22%20-f%20%24webUrl)%3B%0AConnect-PnPOnline%20-Url%20%24webUrl%20-Credentials%20WCMStoredCredentials%3B%0AWrite-Output%20%22Context%20obtained%22%3B%0AWrite-Output%20%22Creating%20PnP%20template...%22%3B%0AGet-PnPProvisioningTemplate%20-Out%20%24path%20%0AWrite-Output%20%24(%22Template%20saved%20to%20%7B0%7D%22%20%E2%80%93f%20%24path)%3B%3C%2FPRE%3E%3CP%3EThen%20we%20connect%20to%20our%20tenant%2C%20to%20replicate%20the%20environment%2C%20and%20we%20created%20a%20site%20collection%20with%20the%20same%20publishing%20template%20and%20execute%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%23%20Define%20variables%0A%24tenant%20%3D%20%22ourowntenant%22%3B%0A%24targetSite%20%3D%20%22%2Fsites%2FDevHumax%22%3B%0A%24path%20%3D%20%22C%3A%5CTemplates%5CHumaxTemplate1.pnp%22%3B%0A%24siteTitle%20%3D%20%22My%20Target%20Site%22%3B%0A%24siteDescription%20%3D%20%22%20%22%3B%0A%24siteUrl%20%3D%20%22ourowntenant.sharepoint.com%22%3B%0A%0A%23%20Get%20context%0A%24webUrl%20%3D%20%22https%3A%2F%2F%7B0%7D.sharepoint.com%2F%7B1%7D%22%20-f%20%24tenant%2C%20%24targetSite%3B%0AWrite-Output%20%24(%22Connecting%20to%20%7B0%7D...%22%20-f%20%24webUrl)%3B%0AConnect-SPOnline%20-Url%20%24webUrl%20-Credentials%20WCMStoredCredentials%3B%0AWrite-Output%20%22Done%22%3B%0A%0A%23%20Create%20new%20subsite%0A%24web%20%3D%20Get-PnPWeb%20-Identity%20%2Fsites%2FDevHumax%0A%23%20New-SPOWeb%20-Title%20%22%24siteTitle%22%20-Url%20%22%24siteUrl%22%20-Description%20%22%24siteDescription%22%20-Locale%201043%20-Template%20%22STS%231%22%0A%0A%23%20Apply%20template%0AWrite-Output%20%24(%22Applying%20PnP%20template%20%5B%7B0%7D%5D%20to%20site%20%5B%7B1%7D%20(%7B2%7D)%5D...%22%20-f%20%24path%2C%20%24web.Title%2C%20%24web.Url)%3B%0AApply-PnPProvisioningTemplate%20%24path%3B%0AWrite-Output%20%22Done%22%3B%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%20we%20get%20this%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EApply-PnPProvisioningTemplate%20%3A%20The%20Provisioning%20Template%20URI%20HumaxTemplate1.xml%20is%20not%20valid.%0AAt%20line%3A2%20char%3A1%0A%2B%20Apply-PnPProvisioningTemplate%20%24path%3B%0A%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0A%20%20%20%20%2B%20CategoryInfo%20%20%20%20%20%20%20%20%20%20%3A%20WriteError%3A%20(%3A)%20%5BApply-PnPProvisioningTemplate%5D%2C%20ApplicationException%0A%20%20%20%20%2B%20FullyQualifiedErrorId%20%3A%20EXCEPTION%2CSharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-361003%22%20slang%3D%22en-US%22%3ERe%3A%20The%20Provisioning%20Template%20URI%20HumaxTemplate1.xml%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-361003%22%20slang%3D%22en-US%22%3E%3CP%3EI%20had%20the%20same%20problem...%20I%20think%20the%20problem%20was%20you%20changed%20the%20filename%20of%20the%20pnp-template.%20You%20created%20a%20template%20as%20humaxtemplate.pnp%2C%20then%20I%20guess%20you%20changed%20the%20pnp-File%20to%20humaxtemplate1.pnp%2C%20then%20the%20applying-process%20fails.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-181053%22%20slang%3D%22en-US%22%3ERe%3A%20The%20Provisioning%20Template%20URI%20HumaxTemplate1.xml%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-181053%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20also%20facing%20the%20same%20error%2C%20did%20you%20find%20any%20solution%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-128064%22%20slang%3D%22en-US%22%3ERe%3A%20The%20Provisioning%20Template%20URI%20HumaxTemplate1.xml%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-128064%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20you%20find%20a%20solution%3F%20I%20have%20the%20same%20error.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Deleted
Not applicable

We connect to our customer tenant and get a .pnp file without errors:

 

 

$tenant = "ourcustomertenant";
$sourceSite = "/sites/ClientesNotaCredito";
$webUrl = "https://{0}.sharepoint.com{1}/" -f $tenant, $sourceSite;
$path = "C:\Templates\HumaxTemplate.pnp"
Write-Output $("Connecting to {0}..." -f $webUrl);
Connect-PnPOnline -Url $webUrl -Credentials WCMStoredCredentials;
Write-Output "Context obtained";
Write-Output "Creating PnP template...";
Get-PnPProvisioningTemplate -Out $path 
Write-Output $("Template saved to {0}" –f $path);

Then we connect to our tenant, to replicate the environment, and we created a site collection with the same publishing template and execute this:

 

 

# Define variables
$tenant = "ourowntenant";
$targetSite = "/sites/DevHumax";
$path = "C:\Templates\HumaxTemplate1.pnp";
$siteTitle = "My Target Site";
$siteDescription = " ";
$siteUrl = "ourowntenant.sharepoint.com";

# Get context
$webUrl = "https://{0}.sharepoint.com/{1}" -f $tenant, $targetSite;
Write-Output $("Connecting to {0}..." -f $webUrl);
Connect-SPOnline -Url $webUrl -Credentials WCMStoredCredentials;
Write-Output "Done";

# Create new subsite
$web = Get-PnPWeb -Identity /sites/DevHumax
# New-SPOWeb -Title "$siteTitle" -Url "$siteUrl" -Description "$siteDescription" -Locale 1043 -Template "STS#1"

# Apply template
Write-Output $("Applying PnP template [{0}] to site [{1} ({2})]..." -f $path, $web.Title, $web.Url);
Apply-PnPProvisioningTemplate $path;
Write-Output "Done";

 

 

However we get this error:

 

Apply-PnPProvisioningTemplate : The Provisioning Template URI HumaxTemplate1.xml is not valid.
At line:2 char:1
+ Apply-PnPProvisioningTemplate $path;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Apply-PnPProvisioningTemplate], ApplicationException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate
3 Replies
Highlighted

Did you find a solution? I have the same error.

Highlighted

I am also facing the same error, did you find any solution?

Highlighted

I had the same problem... I think the problem was you changed the filename of the pnp-template. You created a template as humaxtemplate.pnp, then I guess you changed the pnp-File to humaxtemplate1.pnp, then the applying-process fails.