Enable Site Collection App Catalog For Particular Site Collection Level Solution/Features

In this article, we will learn how to enable site collection app catalog. By enabling the site collection level app catalog (not the tenant), we can deploy/install SharePoint AddIn/SPFx solutions at the site collection level. Consider this like sandbox solution, as a component is only deployed and is installed on the site collection and not available for other site collections.

Why do we need a Site Collection App Catalog?

There are times and cases when we, as a developer, have to build a solution which is very much specific to a particular project or application. This solution demands a very determined approach to solving a specific problem which is not required for other site collections of your tenant. Below are some of the reasons why we need a site collection app catalog.
  • Provide isolated and focused solution/web part for a particular project.
  • Tenant level App/Add-in is visible to all site collection under a tenant. Risk of installing the app in other site collections is nullified for which solution is not required.
  • Provides controls to Site collection admins to manage solutions specific on site collection.
  • No need to provide access to site collection admins to deploy the app on the tenant.
  • Saves times and faster deployment methodology.

How to enable site collection app catalog?

  • Enabling site collection app catalog for the particular site requires tenant level administrator access.
  • This is a one-time activity to be done by tenant admins.

Option 1 – Using SharePoint Online Management Shell.

Download and install, if not already, SharePoint Online Management Shell from this link.
Once installed, open SharePoint Online Management Shell.
Connect to the Tenant.
Connect-SPOService -Url https://wayneenterprise-admin.sharepoint.com -credential bruce@wayneenterprise.com


Connect to the particular site and run Add-SPOSiteCollectionAppCatalog.
# get a reference to the site collection where the  
# site collection app catalog should be created  
$site = Get-SPOSite https://wayneenterprise.sharepoint.com/sites/justiceleague

# create site collection app catalog  
Add-SPOSiteCollectionAppCatalog -Site $site


Once you go to the site collection, you will see the app for SharePoint library which can be used to deploy the app.

Option 1 – Using Office365 CLI

We can also use PnP Office365 CLI.  See this ummary of what Office 365 CLI is: (reference link)
Using the Office 365 CLI, you can manage your Microsoft Office 365 tenant and SharePoint Framework projects on any platform. No matter if you are on Windows, macOS or Linux, using Bash, Cmder or PowerShell, using the Office 365 CLI you can configure Office 365, manage SharePoint Framework projects and build automation scripts.
Install Office 365 CLI (if not already installed.). Office 365 comes as NPM package which can be installed from Node JS prompt using below command,
  1. npm i -g @pnp/office365-cli


Go to Office 365  CLI. type below command in Node JS command prompt.




Now we are in office 365 CLI and can run office 365 CLI commands.

The next step is to log into Office 365 tenant.
  1. spo login https://wayneenterprise-admin.sharepoint.com 

It will give us the below message.

To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code SAVEGOTHAM to authenticate.

Open  https://microsoft.com/devicelogin in the browser – Enter the code and click “Next”.

Select the account or sign in with a new account,

Click Accept

We will get the below success message, close window.

Go back to Node JS command prompt, run below command to enable app catalog on the particular site collection.
  1. spo site appcatalog add –url https://wayneenterprise.sharepoint.com/sites/justiceleague

If successful, we can go to a particular site and see that the App for SharePoint library should be created.

Now we can directly deploy or App/Add-In or SPFx solution(*.sppkg) directly on the site collection. Deployment and installation of the app is similar to what we do for tenant app catalog.

How to disable the site collection app catalog?

Using Powershell
# get a reference to the site collection in which  
# the site collection app catalog should be disabled  
$site = Get-SPOSite https://wayneenterprise.sharepoint.com/sites/justiceleague  

# disable the site collection app catalog  
Remove-SPOSiteCollectionAppCatalog -Site $site


Using Office 365 CLI

spo site appcatalog remove --url https://wayneenterprise.sharepoint.com/sites/justiceleague



In this article, we have learned how to enable app catalog on the site collection level using PowerShell and Office 365 CLI.
Thanks for reading.


Note – This article was originally published at this link.

(Visited 25 times, 1 visits today)