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.

2 comments:

  1. Hi MArtin. Did you ever get a definitive answer on this?

    I've found some contradictory advice from Microsoft regarding feature stapling support on SharePoint Online... The article you referenced implies that it's not available, however the "SharePoint Online Custom Solution Developers Guide" does (http://www.microsoft.com/en-au/download/details.aspx?id=18128). See the "Feature Stapling" chapter.

    Furthermore, we will be using a shared Office 365 tenant (as apposed to dedicated) -- perhaps this is where the difference in functionality lies?

    ReplyDelete
    Replies
    1. Hi Nick,

      No I haven't seen anything more official than that link in the original post.

      I think you're spot on - Dedicated Office 365 is quite a different beast when compared to a tenancy in a shared 365 environment.

      My understanding is that with the Dedicated offering, what you get is basically the same as when you install SharePoint in your own environment. The main difference is that Microsoft takes care of the platform, and whilst you could technically deploy any customisation to the farm, Microsoft's processes such as MSOCAF ensure that only specific approved customisations get through to the farm. This ensures Microsoft can meet their SLAs even though your customisations are running on the platform.

      On the other hand, the SharePoint installations in shared 365 environments appear to have been customised quite heavily to deliberately lock them down and prevent you from doing things that might effect other tenants. For example, you can create and modify User Profile Properties but you can't edit property mappings if you have profiles imported via ADFS. Also, you can't create your own Managed Properties in search.

      In some cases, this lock down process is perhaps more restrictive than is technically necessary but it would probably be difficult for Microsoft to allow some things through without letting everything through, and this could break the principle of multi-tenancy.

      I think Feature Stapling is probably one of these examples of SharePoint functionality that technically could effect multiple tenancies (e.g. farm features that staple other features), so my guess is that it is completely disabled in shared SharePoint Online tenancies. In theory, a sandboxed site collection feature that staples a web scoped feature couldn't possibly reach across tenancy boundaries, but it might be too difficult or risky for Microsoft to turn feature stapling on because of the potential for other issues.

      Hopefully as SharePoint Online progresses with its quarterly updates, the situation improves and finer granularities are used for this lock downs so that we can get more of our customisations in!

      Delete