Add-SPOSiteCollectionAppCatalog
By default, deploying an SPFx solution to a single SharePoint Online site means either getting it into the tenant app catalog or asking a tenant admin to do it. A site collection app catalog gives one specific site its own private app catalog, so solutions scoped to that site can be deployed there directly — useful for testing a solution before it goes tenant-wide, or for a site that needs an app no one else should have access to.
Purpose
- Connects to the SharePoint Online admin center with PnP PowerShell
- Enables a site collection app catalog on a single target site via
Add-PnPSiteCollectionAppCatalog - Lets that site's owners upload and deploy SPFx packages scoped to it, without needing tenant app catalog access
Prerequisites
- PnP PowerShell module installed
- SharePoint Online admin or Global admin permissions
- Azure AD App Registration (Client ID) for authentication
- The URL of the site that should get its own app catalog
PowerShell Script
#Config Variables
$AdminCenterURL = "https://tenantName-admin.sharepoint.com"
$ClientId = "" #Your tenant Client ID
$SiteUrl = "https://tenantName.sharepoint.com/sites/siteName"
# ── Connect ──────────────────────────────────────────────────
Connect-PnPOnline -Url $AdminCenterURL -Interactive -ClientId $ClientId
# ── Add site collection app catalog ──────────────────────────
Add-PnPSiteCollectionAppCatalog -Site $SiteUrl
# ── Disconnect ────────────────────────────────────────────────
Disconnect-PnPOnline
Write-Host "Done." -ForegroundColor Cyan
Usage Notes
- Admin URL: Update
$AdminCenterURLto your tenant's SharePoint Admin Centre URL - Site URL: Update
$SiteUrlto the specific site that should get its own app catalog — this is a per-site action, not a tenant-wide one - Scope: Apps deployed to a site collection app catalog are only available on that site, not across the tenant
- Precedence: If an app with the same ID exists in both the tenant app catalog and the site collection app catalog, the site collection version takes precedence on that site
- Permissions: Site owners can deploy to a site collection app catalog without needing tenant app catalog access, which is the main reason to use one