
When developing SharePoint (SP) Add-ins, you will generally want to avoid having to deploy them to your SharePoint Online (SPO) tenancy’s public app catalogue until you are going to release them. Microsoft have catered for this and there is a way to enable a ‘developer’ app catalogue at site-collection level using some PowerShell commands.
First of all you’ll need to get the SPO PowerShell module if you don’t already have it installed. You can do this by opening an elevated PowerShell session (i.e. Run As Administrator) and then check if the module is installed.
Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version
Code language: PowerShell (powershell)
The above command should list any module versions that are installed. If there aren’t any, then you can install the module as follows:
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
Code language: PowerShell (powershell)
You may get warnings that the gallery URL is untrusted or that you need to install NuGet first – just do these (assuming you trust Microsoft!)
Run the following commands to connect to your tenant SPO admin interface and create your site collection specific app catalog:
Connect-SPOService -Url https://Contoso-admin.sharepoint.com
Add-SPOSiteCollectionAppCatalog -Site "https://Contoso.sharepoint.com/sites/mydevsite"
Code language: PowerShell (powershell)
Obviously, you’ll need to replace the ‘Contoso-admin’ and ‘Contoso’ sub-domain parts with your own tenancy details and alter the sub-site URL as necessary.