PnP Provisioning Templates

PnP Provisioning Templates

There is a very large community with even Microsoft employees involved that also has a provisioning engine available: PnP Provisioning.
PnP Provisioning Templates are also XML templates, but there is no Admin website to manage your provisioning requests and so on. You’ll need something like PnP PowerShell to execute those templates.
Make also supports these kinds of PnP Provisioning templates.

More info: https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine

Example

The following XML template is an example how a PnP Provisioning Template looks like. This examples creates a subsite with a list called SubList with 2 columns FirstName and LastName.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2021/03/ProvisioningSchema">
  <pnp:Preferences Generator="PnP.Framework, Version=1.10.0.0, Culture=neutral, PublicKeyToken=0d501f89f11b748c" />
  <pnp:Templates ID="CONTAINER-TEMPLATE-44FD56202D634CE8A17A40DE6D17FA5E">
    <pnp:ProvisioningTemplate ID="TEMPLATE-44FD56202D634CE8A17A40DE6D17FA5E" Version="1" BaseSiteTemplate="STS#3" Scope="Web">
      <pnp:Properties>
        <pnp:Property Key="mvMakeBaseTemplate" Value="STS#3" />
      </pnp:Properties>
      <pnp:PropertyBagEntries>
        <pnp:PropertyBagEntry Key="WebTemplate" Value="SubSite-Demo" Overwrite="false" />
      </pnp:PropertyBagEntries>
      <pnp:Lists>
        <pnp:ListInstance Title="SubList" Description="Demo list on subsite" DocumentTemplate="" OnQuickLaunch="true" TemplateType="100" Url="Lists/SubList" EnableVersioning="true" MinorVersionLimit="0" MaxVersionLimit="50" DraftVersionVisibility="0" TemplateFeatureID="00bfea71-de22-43b2-a848-c05709900100" EnableFolderCreation="false" DefaultDisplayFormUrl="{site}/Lists/SubList/DispForm.aspx" DefaultEditFormUrl="{site}/Lists/SubList/EditForm.aspx" DefaultNewFormUrl="{site}/Lists/SubList/NewForm.aspx" ImageUrl="/_layouts/15/images/itgen.png?rev=47" IrmExpire="false" IrmReject="false" IsApplicationList="false" ValidationFormula="" ValidationMessage="">
          <pnp:ContentTypeBindings>
            <pnp:ContentTypeBinding ContentTypeID="0x01" Default="true" />
            <pnp:ContentTypeBinding ContentTypeID="0x0120" />
          </pnp:ContentTypeBindings>
          <pnp:Views>
            <View Name="{6851B998-1F38-438F-A6D5-9C5F8A0CE1F1}" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" Type="HTML" DisplayName="All Items" Url="{site}/Lists/SubList/AllItems.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/15/images/generic.png?rev=47">
              <Query />
              <ViewFields>
                <FieldRef Name="LinkTitle" />
                <FieldRef Name="FirstName" />
                <FieldRef Name="LastName" />
              </ViewFields>
              <RowLimit Paged="TRUE">30</RowLimit>
              <JSLink>clienttemplates.js</JSLink>
              <CustomFormatter />
            </View>
          </pnp:Views>
          <pnp:Fields>
            <Field DisplayName="FirstName" Format="Dropdown" IsModern="TRUE" MaxLength="255" Name="FirstName" Title="FirstName" Type="Text" ID="{0e82bdc7-797b-4135-931d-67d881a6a3de}" SourceID="{{listid:SubList}}" StaticName="FirstName" ColName="nvarchar4" RowOrdinal="0" />
            <Field DisplayName="LastName" Format="Dropdown" IsModern="TRUE" MaxLength="255" Name="LastName" Title="LastName" Type="Text" ID="{d9df39ff-7382-41cf-8c81-c0efa219bba6}" SourceID="{{listid:SubList}}" StaticName="LastName" ColName="nvarchar5" RowOrdinal="0" />
          </pnp:Fields>
        </pnp:ListInstance>
      </pnp:Lists>
      <pnp:Features>
        <pnp:WebFeatures>
          <pnp:Feature ID="992f7f2f-1a54-4fb1-a29d-aca651e10c40" />
        </pnp:WebFeatures>
      </pnp:Features>
      <pnp:Header Layout="Standard" ShowSiteTitle="false" ShowSiteNavigation="false" />
    </pnp:ProvisioningTemplate>
  </pnp:Templates>
</pnp:Provisioning>

How to use PnP in Make?

That’s easy. Just use this kind of XML in your configuration.xml instead of the Make XML variant. That’s it.

Do you want to know what entities and properties can be used? Check out the PnP Provisioning Schema at https://github.com/pnp/PnP-Provisioning-Schema