5

I am trying to gain some traction on a new SPO project and it's been indicated to me that they want to maintain the site programmatically with PnP templates (XML files basically). The idea is that we have a git repo with our PnP templates with the aim that we could hook it up to continuous integration and as we update the template it deploys directly from source control.

However I am not sure if this is the correct approach at all. Barring trial and error I don't feel confident that I can determine if a PnP template XML file being changed and deployed repeatedly to the same tenant will gracefully deploy changes in the first place.

In fact, I don't even know if this is the best workflow at all, but it's been indicated to me that editing the XML is the development process... something doesn't smell right about it though.

Note that I am coming from a traditional full-stack development background where I am most familiar with the workflows of rolling ASP.NET websites with JS front-ends and EF/SQL in the back. Through that lens this SharePoint development/versioning/deployment stuff is rather disorienting.

1 Answer 1

2

This is a fairly common workflow, one I've used in multiple projects. The templates can be safely repeatedly deployed to the same site but watch for templates that do upgrades to existing sites, the templates won't remove anything so you may have to supplement your upgrade process with some PNP PowerShell if you are changing stuff (rather than adding stuff, as the template will do).

I had a project that applied the templates in a release but that was a bit limiting - for a different project instead I had the release push the templates to Blob storage, and an Azure Automatio Runbook that was basically a Powershell script that downloaded the template and applied it with Apply-PnPProvisioningTemplate.

That way we could add parameters to the script that would be set via the Runbook at execution time.

The beauty of this approach is that we can kick off the Runbook via Flow attached to a SharePoint list that manages the sites that will have the template applied to it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.