SharePoint 2013 App Deployment through "App Stapling"

Feature Stapling is a popular development practice for adding functionality to a specific type of site in SharePoint.  Although it has become the preferred approach over custom site definitions, it still requires the deployment of a farm solution.  Unfortunately, SharePoint Online doesn’t support features stapling or custom site definitions.  So how can an organization deploy capabilities to a group of existing sites or new sites that match specific criteria?  The answer is app deployment through an app catalog…something I like to call “app stapling”.  Here is a video that illustrates the concepts outlined in this blog post:


The App Catalog

The App Catalog is a special site collection aimed at storing, managing, and delivering Office/SharePoint apps to the enterprise.  Administrators of an App Catalog can upload apps and make them available to site owners (they can also flip a kill switch to disable the apps).  However, administrators can also use the catalog to push apps to specific site collections, managed paths, and site templates.  To get started, you should provision an app catalog in your tenancy (on premise users will need to do additional steps outlined in Configure an environment for apps for SharePoint).  This can be done from SharePoint Admin Center in Office 365 by clicking on the Apps link in the side navigation and then selecting App Catalog:

Once the App Catalog has been provisioned, it should look similar to this:

App Deployment

In order to "push" and app out to specific sites, we first need to upload it to the App Catalog.  Navigate to the App Catalog and select the Apps for SharePoint link in the side navigation.  You can simply drag/drop an .app file into this library to make it available to the organization:

Next, we need to install the app into the App Catalog (not to be confused with uploading to the App Catalog).  This seems a little odd, but it is the only way to push it specific sites in the tenancy.  You can install the app into the App Catalog just like you would from any other SharePoint site.  Select Site Content > add an app > From Your Organization > and select the app to install:

Now that the app is installed into the App Catalog, we can manage the deployment to other sites.  Select Site Content from the App Catalog and find the installed app.  Selecting the ellipse should display a "Deployment" option does doesn't display in other sites:

This Manage App Deployment screen allows an administrator deploy/retract an app to/from specific site collections, managed paths, and site templates.  Performing this "app staple" will work on all existing sites and any new sites that meet the criteria.

A few interesting notes about how this functions:

  • Similar to deployment, an App Catalog administrator can retract apps from specific sites (or flip the kill switch to disable it from all sites)
  • Because the app is pushed by an administrator, site owners will not be able to remove the app from a site that meets the deployment criteria.  Not even a site collection administrator can remove the app.
  • This centralized deployment also share the same centralized app resources (App Web and Remote Web).  Essentially, the app is deployed, but not installed in the sites.  All sites will leverage the App Web and Remote Web from the instance installed in the App Catalog.  This significantly changes tenancy considerations for SharePoint-hosted and Autohosted apps, which typically get their own dedicate app resources.
  • Because of centralized deployment, remote events such as “Handle App Installed”, “Handle App Uninstalled”, and “Handle App Upgrade” will only fire once (when the app is installed in the App Catalog).  Because of this, I think it will be hard to leverage “App Stapling” for branding purposes.  I’ve successful developed branding apps that deploy/set a masterpage from the App Web, but the remote events were a key part of that solution.

Final Thoughts

App deployment through the App Catalog provides a great deal of flexibility and governance for SharePoint deployments on-premise and in Office 365.  I can see “App Stapling” being used for a number of scenarios where feature-stapling has been used in the past.

Comments (23)
  1. Dennis J says:

    Good information, thanks for documenting this. Bummer that the forced deploys don't fire some sort of event.

  2. Bruno says:

    Do you know if there is any way to make "App Stapling" or "Feature Stapling" to deploy/set a masterpage to My Sites?

  3. Bruno – I've been able to achieve this, but it is buggy for the following reasons:

    – app installed events (which would be used for applying the masterpage to the site) only fires for the app catalog…not the individual sites

    – the masterpage needs to live within the site collection to be accepted and this is hard to do for new site collections

    – the app web isn't the best location for the masterpage because of potential authentication hops, but the only clean option you really have control of from your app.

    I think owning the provisioning process is a much better approach as is outlined in the following post:…/self-service-site-provisioning-using-apps-for-sharepoint-2013.aspx

  4. Muthu says:

    Thanks.  Can you write a blog on how you developed app to brand RootWeb and handled remote events?  I look forward implementing a branding solution (App) for Office 365 sharePoint 2013 online via Apps.

  5. Very interesting article! Thanks Richard!

    I am also struggling with the branding of personal sites (see a recent discussion here…/how-do-you-customize-every-new-users-mysite-in-sharepoint-online- )

    Would be awesome to find a solution which works as well as feature stapling for SharePoint Online

  6. Great post!  And thank you for including the details on the setup on-premise as well.

  7. Jason says:

    How do we do this via powershell for OnPrem deployments?

  8. Karu Karthi says:

    While debugging it is working fine,but When I try to deploy the SharePoint auto hosted app I am getting the error – Correlation Id: 4e2aa7aa-00be-4a4f-83bb-362a567c0e21

    ErrorDetail: The remote hosting service is not configured.

    ErrorType: Configuration

    ErrorTypeName: Configuration



    Target application not found (application id:


  9. Jesper M. Christensen says:

    Thanks for tthis great guide 🙂

    In my experience the logged in user account need to be a "Site Collection Administrator" of the App Catalog Site Collection. If not, then you cannot se the "Deployment" link.

  10. Alex D. says:

    Thanks for the guide. But I have  one question:

    My app has custom actions. During deploying they are lost (not shown in the ribbon). Is there any way to publish custom actions??

  11. Sven G says:

    Is there a way to use an app part within the target site of the shared app. I can only view the app part within my app when I install the app on the target site instead of the app catalog site.

    Thanks in advance

  12. Patrick Powers says:

    Useful and informative posting Richard! We've recently deployed a Help App using this method.

  13. Josh Petryk says:

    Hi Richard, did you post any blogs that continue on about the following:

    "I’ve successful developed branding apps that deploy/set a masterpage from the App Web, but the remote events were a key part of that solution."

    I'm interested in learning more about remote events in these tenant scoped apps. Thanks!

  14. I am excited to see drag n drop skips over the whole deployment process that was time consuming in previous versions.

    I have a question: if you are deploying an App which will inject code into the Master Pages for individual Sites, how would (or if) you make sure that the injected code was removed when the App is?

  15. siva kumar says:

    HI Very Good Article which help me to develop app in sharepoint 2013.

    But i am having one more issue after configuring and deploying app to site .

    When i click to open app in browser ,it is asking credentials,but even though i am providing admin credentials,it is not accepting.

    Because of this i am not able to open app that i have developed.

    Kindly can any body share there knowledge how to resolve this issue

  16. sivakumar says:

    Can any body share solution for resolving the app's error in sharepoint 2013.

    In previous blog,i mentioned Issue that i am facing while developing and aceesing app in sharepoint 2013.

  17. chandrashekhar says:

    I have followed the steps as mentioned in the blog and also got the app installed on another site collection but in another site collection i never get the  about option for the app

  18. sowjanya says:

    Hi ,

    I am having app in site .

    But when i click on that Thirdparty app.

    I am getting This webpage not available.

    Any idea.

    Thank you,


  19. Major flaw with this approach says:

    The link on the chrome control in a Hosted app points to the app catalog not the original web the user came from.

  20. Drew says:

    Great post! How is this not more well known?

  21. sharepoint tutorials says:

    Thanks so much! Your instructions are very clear and helpful. I've been wondering how to do this for months and thrilled to find out how finally!

    <a href="…/">sharepoint tutorials</a>

  22. John Palmer says:

    Great post!  

    I'm able deploy my branding app without changes because it uses the "SPHostUrl" query string parameter to upload the modifying JavaScript to the correct web.  I'll add my own querystring parameters to automate and customize the appweb to hostweb upload action.  (See the Office Dev Center Patterns and Practices sample, Core.EmbedJavaScriptJSOM.…/PnP)

    I can't find any way to automate the Deployment from the App Catalog.  Is there a PowerShell or CSOM way of doing this?

  23. Can I share an app, sharing the URL? says:

    Scenario: I have 10 site collections. An app for SharePoint is installed on one of the site collections. The same app needs to be called from all other site collections as a link. Is that possible to do?  Is there a way that I can get the URL of the site collection when it is invoked from other site collections?

Comments are closed.

Skip to main content