GUITACA BLOGS
Blogs from our authors

Microsoft 365: The best recipes for developers
Gustavo Velez
Learn more and buy
Return to Blogs
The SharePoint App Catalog at Site Collection levelGustavo Velez
When deploying SPFx components, the SharePoint Online hosting model allows to use for a particular, local Site Collection App Catalog instead of deploying to the full tenant03-11-2020
SharePoint

Although it is widely known how to deploy SPFx components to the SharePoint Online tenant, it is not well-known that the same can be done to a particular Site Collection, by enabling a local App Catalog in the collection. This opens a plethora of possibilities: the SPFx components will be not visible nor available in any other place in the tenant (isolation), installation of specialized components in other Site Collections will be not possible (security), the Site Collection owners are in control of the components deployment in the collection (tenant Admins are not required anymore, ideal for development/testing), etc.

Creating a local App Catalog in a Site Collection requires tenant-level administrator access, but this is a one-time activity. To configure the Site Coll, the SharePoint Online Management Shell is necessary (it can be downloaded from https://www.microsoft.com/en-us/download/details.aspx?id=35588).

Open PowerShell as administrator y execute the following commands:

$myCred = Get-Credential
Connect-SPOService -Url "https://[Domain].sharepoint.com-admin " -Credential $myCred
$mySite = Get-SPOSite https://[Domain].sharepoint.com/sites/[SiteName]
Add-SPOSiteCollectionAppCatalog -Site $mySite

PnP can also be used: the cmdlet Add-PnPSiteCollectionAppCatalog does the same work as Add-SPOSiteCollectionAppCatalog, and it requires tenant admin rights as well.

To delete the App Catalog from the Site Collection, use Remove-SPOSiteCollectionAppCatalog -Site $mySite

After the Site Collection is configured in this way, go to the Site Contents page, and you will see the new local App Catalog as a List called Apps for SharePoint:

The functionality, layout, and use of the local App Catalog is the same as the tenant App Catalog:

Note: When creating SPFx WebParts to be installed in a local App Catalog, use Yes in the option Do you want to allow the tenant admin the choice of being able to deploy the solution to all sites immediately without running any feature deployment or adding apps in sites? in the Yeoman generator:

And then, to facilitate the installation of the WebPart in any page in the Site Collection, when installing the package in the local App Catalog, check the option Make this solution available to all sites in the organization:

Return to Blogs