Forum Discussion
Invoke-PnPSiteTemplate slower than it used to be
Hi everyone,
Since last Friday, our provisioning engine has become noticeably slower than usual, and it's now blocking site creation for one of our customers.
Setup
- Azure Function App (Windows OS, Consumption plan, hard 10-min timeout)
- Provisioning engine applies a PnP site template to newly created SharePoint sites via Invoke-PnPSiteTemplate
- PnP PowerShell: 2.12.0
- PowerShell: 7.6
What changed Previously, if a run went over the 10-min limit, it wasn't a real problem: our retry mechanism kicked in, and the second pass was much faster because a large part of the template had already been provisioned. Now, however, every run stays slow and consistently hits the 10-min timeout, so the retry never gets far enough to complete. The result is that the customer's sites are no longer being created.
My question
- Has anyone else seen this same slowdown since last Friday?
- Could this be related to the recent CSOM issue with Invoke-PnPSiteTemplate / Set-PnPDefaultColumnValues? (Invoke-PnPSiteTemplate AND Set-PnPDefaultColumnValues error since this morning | Microsoft Community Hub)
Any confirmation or workarounds would be greatly appreciated.
Thanks!
1 Reply
The failure is the Azure Functions Consumption-plan limit: a function can run for at most ten minutes, so a slower template application cannot wait longer on that plan. The fact that every retry now times out means the first pass is not reaching a resumable point; it does not by itself confirm a Microsoft CSOM regression. Capture a run log for each template phase, PnP PowerShell version, correlation IDs, and the first operation whose duration changed. Test the same template against one new site outside the Function and compare it with a minimal template to isolate a handler or tenant-side delay. Make creation idempotent so retries skip verified completed work instead of reapplying it. For the blocked workload, move the long-running orchestration to a plan or asynchronous design that fits the documented execution model, then retain the 10-minute function only to start and monitor the work. Escalate with log evidence.