One of the few hidden gems of SharePoint Online hosting model is Site Collection App Catalog. Yes, you read it right, Site Collection App catalog !!!, not Tenant App catalog. Don’t confuse this with delegating app catalog rights to Site Collection Administrators. This is different and the requirement is to have the app deployed and scoped to a Site Collection only. For more details about deployment options, please check here
So what does it mean by Site Collection App catalog ? Site Collection App catalog, as the name rightly implies, is an App catalog scoped for a site collection. In other words, it elevates a Site Collection to allow hosting Apps and create a App Catalog in the Site Collection.
The Site Collection App Catalog could be enabled using the following script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|$cred = Get-Credential|
|Connect-SPOService -Url "https://<tenant>-admin.sharepoint.com" -Credential $cred|
|# get a reference to the site collection where the|
|# site collection app catalog should be created|
|$site = Get-SPOSite https://contoso.sharepoint.com/sites/marketing|
|# create site collection app catalog|
|Add-SPOSiteCollectionAppCatalog -Site $site|
|# disable the site collection app catalog|
|Remove-SPOSiteCollectionAppCatalog -Site $site|
1. Deploy apps to the Site Collection scope only. Even if tenant app setting is On in web part, the Tenant Apps are deployed to site collection scope only
2. Apps can only be added in the installed site collection and thus decreasing risk of accidental installation at other locations
3. Allow Site Collection Administrators to manage deployments
4. There is support for SharePoint Add Ins
5. When included in the package, the assets are deployed and maintain in the site collection only
6. Distributed release cycle management could allow better functionality for upgrades
1. Lack of tracking Site Collections where the Site Collection App catalog feature is On
2. Removal of Site Collection App catalog still leaves the App catalog library but apps cannot be installed
3. No technical restrictions to prevent the web parts from accessing other site collections
In the above blog we saw how to use Site Collection App Catalog for deploying web parts in the restricted scope of Site Collection.
i wasw expecting to see here a script on how to automate the deploys in this case, not how to enable it 🙂
oh that blog is also there, just not this one. Here is the link, c# code though. let me know if any other version is of intereset https://asishpadhy.com/2018/09/19/deploy-and-add-spfx-webparts-to-modern-pages-using-officedevpnp-csom-library/