SharePoint look book: how to provision templates to non-English tenants

SharePoint look book: how to provision templates to non-English tenants

Introduction

Over the last weeks since Ignite 2019, the SharePoint look book got more and more attention. Microsoft showcases beautiful designs on the look book page, and with the help of the SharePoint provisioning service, you can deploy those designs within a few clicks from an admin user.

This is an excellent feature and allows you to deploy lovely demo site collections within minutes. That would be all great unless someone made a significant mistake during the creation of your tenant. In my case, that was me.

I’m still not 100% sure how, but I think by choosing Austria as my home country during the tenant sign up, German got picked as kind of a default language for some parts of Office365 and SharePoint. By clicking through your Delve user profile, you can change your personal language, and in a site collection, you can switch the regional settings to whatever you want.

One thing I’m not able to change is the default language of the SharePoint admin centre site collection. And my theory currently is, this is a very very crucial setting when creating new sites with the SharePoint provisioning service.

The problem

Let’s start with a few observations. Earlier today, I tried to create new site collections in various ways. What I wanted to avoid is the creation of the default document library in a site with the German URL of “Freigegebene%20Dokumente” like in https://thomy.sharepoint.com/sites/contosoDE/Freigegebene%20Dokumente/. The English version of the default document library has a URL of “Shared%20Documents” which is the exact translation of the German one.

Why would I want to avoid the German part in the URL? Well, if you look at the templates, the SharePoint provisioning service uses, for example, the one at  https://github.com/SharePoint/sp-dev-provisioning-templates/blob/master/tenant/thelanding/source/template.xml called “The Landing”, and you pay close attention to lines 103 to 106 you see a reference there to a folder named “Shared%20Documents”. And that appears to be the problem with non-English tenants and the provisioning service.

Finding a workaround

To get this fixed, I tried a few ways to create an English site collection in my tenant. One approach was using the web UI of SharePoint. After realising that changing the language in my Delve profile only affected the visualisation but not the creation of new sites, I started playing with the regional settings of the root site collection. By doing so, I managed to switch https://thomy.sharepoint.com/_layouts/15/regionalsetng.aspx to an English user interface and changed the default behaviour for new site collections created from there.

Make no mistake if you only select English in the dropdown of the Create site dialogue, you will still end up with a new site collection that might use English as the display language. But the default document library URL is still in the same form as the regional settings of your tenant root site collection, which means German in my case.

The second way to create a new site collection I tried was PnP PowerShell. After switching the regional settings in my root site collection, I’m able to connect to the root site and use New-PnPSite to create a new site collection.

At this point, I thought, let’s just change the SharePoint admin site collection to English, and everything should be fine. As so many times in the past years, SharePoint wasn’t beat that easy. If you go to your admin site collection, you quickly realise, there is no site settings link that points to the same config page like in a regular site collection. If you copy the _layouts link from a standard site collection over to your admin site collection you will see the following screen:

So no way to change the default language here. My theory, after going through the code of the SharePoint provisioning service is, that the service connects to the admin site to provision a new communication site and afterwards applies whatever is defined in the chosen site template. I created quite a few site collections earlier today. Whenever I started by connecting the PnP PowerShell to an English site collection, I was able to create a new site collection and apply the “Landing” template on my tenant. But when I connected to the admin site collection I always ended up with the German default document library and provisioning failed. That is step by step the same thing the online service does and my best guess why the remote provisioning also fails.

The Landing template - current solution

As the PnP templates of the SharePoint look book are available at Github I was able to play with them on my local machine instead of using the provisioning service. By doing so, I ended up with a modified version of the “Landing” template.xml that also works on German site collections. The easy fix is to add the “Documents” library to the template to guarantee it exists when the template needs to store the sample files to the new site collection.

I just exported the English version from one of my existing sites with PnP PowerShell and added the library in the node of the file. With that list configuration present, the PnP PowerShell creates the needed document library and applying the “Landing” template works perfectly on my non-English site collections.

I didn’t have the time yet to test other templates of the look book, therefore I can’t guarantee that this approach will solve all template language problems. But my guess is quite a few use the default document library to store the example data. It’s also not the most elegant solution to the problem as you end up with two document libraries called “Documents” but with a different URL.

But the whole point of the last four hours was to deploy the “Landing” template from the look book on my German tenant and find the reason why it fails for the SharePoint provisioning service. And that goal is achieved:

The Perspective template

In order to get the “The Perspective” template to run it needs one more step. Like the “Landing” template it again uses the default document library to store example documents in the site collection. In addition, it also creates content for the events lists. There is an additional problem with that event list. At the moment I’m unable to enter the demo data from the template to the list.

There are some default events listed in the template. But whenever I try to apply this template to my non-English site collection it fails telling me there is no such list:

To get rid of this error I see to options. Number one would be creating the demo data on your own, because everything else from the template works, it really only has problems with the data rows. Number two is to create your site collection, go in and delete the event list and let the template create the list. That approached worked for me and is easier in my opinion.

Conclusion

At the moment you are able to deploy the two new cool templates The Landing and The Perspective on your non-English based tenant only with the help of the PnP PowerShell and some minor modifications to the existing templates. For me at the moment a fine solution as for my use case it doesn’t really matter if I use the service or the command line. In order to also make this possible for the service, I need a little bit more time to investigate and find a possible solution the PnP team is also happy with.

A big Thank You goes out to Vesa Juvonen and Paolo Pialorsi who pointed me in the right direction in some discussions on that topic last week. If after some more testing this turns out to be a proven workaround I’m happy to create a pull request for the templates to make sure they all also work on a tenant with another language than English as it’s default setting.