Provisioning
LiveTiles Intranet Provisioning enables administrators to configure how site collections should be provisioned, i.e. what kind of lists are required on the site collection, how the navigation should be structured, etc. That way workspaces can be created on site collections that fit the needs of the users.
For the provisioning functionality LiveTiles Intranet uses PnP Provisioning Framework from Microsoft. For more detailed information, please consult their documentation.
In a nutshell a PnP Provisioning Template is an XML-file containing the definition of a SharePoint site. PnP enables you to export an existing SharePoint site to an XML file and use that template to provision other/new sites. This can be done using PowerShell.
To install PnP use an elevated SharePoint Online Management shell and execute following command:
Install-Module SharePointPnPPowerShellOnline
Please note that for SharePoint 2019 you need to
Install-Module SharePointPnPPowerShell2019
instead.
Once the PnP module is installed, use following commands to connect to a site and export it as an XML file:
Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/example
Get-PnPProvisioningTemplate -Out <c:\path\to\templatetemplate.xml>
This template can be uploaded to a SharePoint document library and referenced in a WorkspaceType configuration from LiveTiles Intranet Workspaces as follows:
"provisioningConfig": {
"templateWebUrl": "https://tenant.sharepoint.com",
"templateContainer": "ProvisioningTemplates", // = name of document libary
"templateNames": {
"STS#3": ["template.xml"] // STS#3 specifies for which SharePoint site template config can be used
}
},
Basically all that LiveTiles Intranet Provisioning does is load that PnP Provisioning Template and apply it to the target site. In case there are any errors, it's most probably related to the template itself. That's why we recommend testing your template manually, before using it together with LiveTiles Intranet Provisioning. You can do this by applying it to a site collection using PowerShell:
Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/targetsite
Apply-PnPProvisioningTemplate -Path <c:\path\to\templatetemplate.xml>
Some Additional notes:
- If you export a template from an existing site, it might not be valid per default, as certain elements might not be complete, etc. We recommend validating it as mentioned above and/or validating it against the XML schema.
- An exported template most probably contains too much information, for example lists and navigation nodes, etc. We recommend removing everything that is not really needed, for example because it's already done by the SharePoint site template used to initially create the site.
- Please note that PnP Provisioning templates are based on a specific SharePoint site template, that's why you also need to configure it accordingly in the
templateNames
property.
PnP Provisioning Tenant Templates
In the Cloud Version, LiveTiles Intranet Provisioning additionally supports the provisioning of PnP Provisioning Tenant Templates.
Tenant Templates are more powerful and support provisioning of functionality that is not specific to a certain SharePoint site collection or web but are applied to the tenant globally.
To apply a Tenant Template, LiveTiles Intranet Provisioning uses a naming convention to detect that it should provision a Tenant Template instead of a normal Provisioning Template.
Tenant Template names need to end with .tenant.xml
.
Example:
"provisioningConfig": {
"templateWebUrl": "https://tenant.sharepoint.com",
"templateContainer": "ProvisioningTemplates", // = name of document libary
"templateNames": {
"GROUP#0": ["Team.tenant.xml"]
}
},
Tenant Templates can be used for example to provision and configure a Microsoft Teams Team.
Parameters
LiveTiles Intranet Provisioning supports Parameters that are passed to the provisioning template.
The latest version of the PnP Provisioning Schema that is supported is: 202002 Provisioning-Schema-Link
When provisioning a site collection of type GROUP#0
via LiveTiles Intranet Workspaces, it passes the following parameters to the Provisioning Service to be used in a provisioning template:
- GroupId (e.g. "f23eb580-4197-4825-9ead-92f5f629f775")
- GroupDisplayName (e.g. "MyGroupName")
- GroupDescription (e.g. "My Group Description")
- GroupVisibility ("Public" or "Private")
These parameters can be used in the provisioning templates (Tenant Template example):
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema">
<pnp:Preferences Author="LiveTiles Intranet Provisioning" Version="1.0"/>
<pnp:Teams>
<pnp:Team GroupId="{parameter:GroupId}" DisplayName="{parameter:GroupDisplayName}" Description="{parameter:GroupDescription}" Visibility="Public">
<!--
...
-->
</pnp:Team>
</pnp:Teams>
</pnp:Provisioning>
We also pass the workspace's metadata values as parameters as well as customParameters
that can be defined in the workspace config on the provisioningConfig-member. These parameters can be accessed as follows:
- Custom:
{parameter:customParameter_Name}
- Metadata values:
{parameter:field_FieldName}