22 March 2012

Feature Stapling in SharePoint Online (Office 365)

I've been working with sandbox solutions lately and I've come across something rather unexpected: it looks like you can't use feature stapling (the FeatureSiteTemplateAssociation element) in the cloud.

I created a sandbox version of the branding solution I've used a few times in the past to apply a custom master page and some custom CSS to a site. The sandbox version of the solution contains a site collection scoped feature that staples a web scoped feature to a wide range of SharePoint site definitions. This works as expected in my on-premises development environment: when the site collection feature is active, newly created sites have the custom web feature already activated.

However, when I apply the exact same sandbox solution to my SharePoint Online tenancy, the feature stapling doesn't seem to apply. Everything else works except for the stapling. The only information I have been able to find is this link on the Office 365 community site where a Microsoft support team member seems to indicate that feature stapling isn't available in SharePoint Online.

So it seems that for now we'll need to find alternative ways to automatically customise newly created SharePoint Online sites. I'm interested to hear if anyone else has any more info on this or perhaps has found a way to get feature stapling working in Office 365.

Update:
I've just checked the site definition being used for my SharePoint Online site - I had a suspicion that perhaps Online uses slightly different site definitions because this would explain why the feature stapling wasn't being applied. However, the WebTemplate and WebTemplateId properties are both identical in my SharePoint Online site and my on-premises site. So this doesn't explain the difference in behaviour between the two environments.

I've also tried using the GLOBAL value for TemplateName which should staple to all site definitions (except where the AllowGlobalFeatureAssociations property is false), and I still don't see any feature stapling.