What is Sideload feature?
App sideloading, from a SharePoint context, is the ability to install a SharePoint app directly into a site to explicitly bypass the regular governance controls of SharePoint.
Why is it Useful?
The developer site is designed specifically for app developers to install and test apps before they are released to the store. There are certain site collection templates, such as Team Site and Project, which are not compatible to deployed app directly. This means that developers cannot test apps designed for use with those templates with the developer site alone. The sideloading feature enables development against site collections that use a different template without affecting the UI. By enabling sideloading, an admin opens the door for anyone with app install permissions to install apps that are not sourced from the app catalog or app store.
Why below error come when we deployed app in non-developer account in SharePoint online Environment?
Error: Sideloading of apps is not eanbled.
Visual Studio calls the Microsoft.SharePoint.Client.AppCatalog.IsAppSideloadingEnabled method for the given site collection URL, which returns true if the site is a developer site or if the site has the sideloading feature enabled. For a Site Collection to work which is not a developer site, the sideloading feature must be enabled by default this feature is not active for security reason.
Why isn’t it activated by default?
Sideloading apps is insecure. The main reason for blocking sideloading by default on non-developer sites is the risk that faulty apps pose to their host web/host site collection. Apps have the potential to destroy data and make sites or, given enough permissions, can even make site collections unusable. Therefore, apps should only be sideloaded in dev/test environments and never in production.
The secondary reason is that the user experience and management experience for sideloaded apps is inferior to apps published in the app catalog. There is no metadata about the app and updates have to be managed manually.
Please follow the below steps and you can successfully activate the sideloading feature in your non-developer site collection
Step1: Save below script file in C drive with EnableSideload.ps1 name.
$programFiles = [environment]::getfolderpath(“programfiles”)
add-type -Path $programFiles’\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll’
Write-Host ‘Ready to enable Sideloading’
$siteurl = Read-Host ‘Site Url’
$username = Read-Host “User Name”
$password = Read-Host -AsSecureString ‘Password’
$outfilepath = $siteurl -replace ‘:’, ‘_’ -replace ‘/’, ‘_’
[Microsoft.SharePoint.Client.ClientContext]$cc = New-Object Microsoft.SharePoint.Client.ClientContext($siteurl)
[Microsoft.SharePoint.Client.SharePointOnlineCredentials]$spocreds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
$cc.Credentials = $spocreds
$site = $cc.Site;
$sideLoadingGuid = new-object System.Guid “AE3A1339-61F5-4f8f-81A7- ABD2DA956A7D”
$site.Features.Add($sideLoadingGuid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);
Write-Host -ForegroundColor Green ‘SideLoading feature enabled on site’ $siteurl
#Activate the Developer Site feature
Write-Host -ForegroundColor Red ‘Error encountered when trying to enable SideLoading feature’ $siteurl, ‘:’ $Error.ToString();
Step2: Please check the below screenshots.
open SharePoint 2013 Managemnt shell.
Step3: Set Path of EnableSideload.ps1 file and enter site URL, UserName and Password where we need to activate the sideload feature as shown in image.