How To Enable App SideLoading On Your Non-Developer Office 365 Site Collection On Azure

Welcome to an article on “How to Enable App SideLoading on your Non-Developer Office 365 Site Collection on Azure”. Now for people who are not aware what is Side loading let’s know about that first.

Welcome to an article on “How to Enable App SideLoading on your Non-Developer Office 365 Site Collection on Azure”. Now for people who are not aware what side loading is,  let’s talk about that first.

App SideLoading

App Sideloading is the ability to install a SharePoint app directly into a site to explicitly bypass the regular governance controls of SharePoint. When you want an app directly to be deployed on Office 365 site rather than making it a package and uploading it to the app catalogue, we use this feature. These apps are a developer feature which is just used for test purposes.

The developer site is used for app development which is used for deploying the solutions before adding them to the store so this feature is mostly activated on the Dev site but if not and if you want to activate this feature on another site collection, follow the article below and learn how to do it.

Steps

 

  1. $programFiles = [environment]::getfolderpath("programfiles")  
  2.   
  3. add-type -Path $programFiles'\SharePoint Online Management Shell\' + `  
  4.   'Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll'  
  5.   
  6. Write-Host `  
  7.   'To enable SharePoint app sideLoading, ' + `  
  8.   'enter Site Url, username and password'  
  9.    
  10. $siteurl = Read-Host 'Site Url'  
  11. $username = Read-Host "User Name"  
  12. $password = Read-Host -AsSecureString 'Password'  
  13.    
  14. if ($siteurl -eq '') {  
  15.     $siteurl = 'SiteUrl'  
  16.     $username = 'Username'  
  17.     $password = ConvertTo-SecureString -String 'Paswword'`  
  18.                 -AsPlainText -Force  
  19. }  
  20. $outfilepath = $siteurl -replace ':''_' -replace '/''_'  
  21.    
  22. try  
  23. {  
  24.     [Microsoft.SharePoint.Client.ClientContext]$cc = `  
  25.       New-Object Microsoft.SharePoint.Client.ClientContext($siteurl)  
  26.    
  27.     [Microsoft.SharePoint.Client.SharePointOnlineCredentials]$spocreds = `  
  28.       New-Object `  
  29.       Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)  
  30.    
  31.     $cc.Credentials = $spocreds  
  32.     $sideLoadingEnabled = `  
  33.     [Microsoft.SharePoint.Client.appcatalog]::IsAppSideloadingEnabled($cc);  
  34.       
  35.     $cc.ExecuteQuery()  
  36.       
  37.     if($sideLoadingEnabled.value -eq $false) {  
  38.         Write-Host -ForegroundColor Yellow `  
  39.           'SideLoading feature is not enabled on the site:' $siteurl  
  40.         $site = $cc.Site;  
  41.             $sideLoadingGuid = `  
  42.            new-object System.Guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D"  
  43.             $site.Features.Add($sideLoadingGuid, $false, `  
  44.             [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);  
  45.             $cc.ExecuteQuery();  
  46.            Write-Host -ForegroundColor Green `  
  47.           'SideLoading feature enabled on site' $siteurl  
  48.     }  
  49.       
  50.     Else {  
  51.         Write-Host -ForegroundColor Green `  
  52.           'SideLoading feature is already enabled on site' $siteurl  
  53.     }  
  54. }  
  55.    
  56. Catch {   
  57.     Write-Host -ForegroundColor Red `  
  58.       'Error encountered when trying to enable SideLoading feature' `  
  59.       $siteurl, ':' $Error[0].ToString();  
  60. }  
  • On this code just add the following inputs : Site URL, Username & Password
  • Once you update them, save the file as a .ps1 file
  • Run this .ps1 file on the installed SPO Management Shell
  • Kindly remember you should be a tenant admin to run this script

Once the execution is completed the App SideLoading feature will get enabled on the site and now you will be able to deploy the app directly from Visual Studio.

This error is common for all developers trying to do RnD on App Development through Visual Studio on Office 365 Apps. Kindly be a part of the article chain to see more app development articles in my upcoming articles.

Until then, keep reading & keep learning!!