Sideloading in SharePoint Online - still possible?

Background:

We're trying to program an app that'll sit in an AppPart in the Master Page for SharePoint Online sites; it'll manage navigation.  My developer has asked me to enabled sideloading for a test site collection.  

My account is a Global Tenant Admin, as well as Primary Site Collection Administrator, and I'm following the instructions here:

http://blogs.msdn.com/b/officeapps/archive/2013/12/10/enable-app-sideloading-in-your-non-developer-site-collection.aspx

both to the letter, and with my own 'log on to SPO script (handles credentials slightly differently).  Both methods run

but I'm still getting:

Error encountered when trying to enable SideLoading feature https://{ourTenancy}sharepoint.com/sites/AppTest : Exception calling "ExecuteQuery" with "0" argument(s): "The remote server returned an error: (403) Forbidden."

Is there any chance that SideLoading has been disabled for some reason?

Edit: I'm aware that we can (and have in the interim) create a site from the Developer template that will allow our AppPart to sit in the master page. 

July 23rd, 2015 10:22am

Hi,

According to your description, my understanding is that you are unable to enable app sideloading feature.

The error you provided is caused by the code in the try block. Please run the lines of code in the try block once at a time. Then provide the problematic lines of code.

Best Regards,

Dean Wang

Free Windows Admin Tool Kit Click here and download it now
July 24th, 2015 10:26am

Yeah, I always do them line by line, but, as you say, it's in a try {}

So, pulling it out, all variable assignments progress silently, then

 $site.Features.Add($sideLoadingGuid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]
::None);

returns

DefinitionId       :
DisplayName        :
Context            : Microsoft.SharePoint.Client.ClientContext
Tag                :
Path               : Microsoft.SharePoint.Client.ObjectPathMethod
ObjectVersion      :
ServerObjectIsNull :
TypedObject        : Microsoft.SharePoint.Client.Feature

and perhaps not surprisingly, 

$cc.ExecuteQuery();

returns

Exception calling "ExecuteQuery" with "0" argument(s): "The remote server returned an error: (403) Forbidden."
At line:1 char:1
+ $cc.ExecuteQuery();
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

July 24th, 2015 10:56am

Hi,

I have run the code in my environment and it worked fine.

Please grant the account permission to full control in the site collection and test whether the issue occurs.

Best Regards,

Dean Wang

Free Windows Admin Tool Kit Click here and download it now
July 30th, 2015 8:54am

Yeah, I created both site collections, and as such I'm automatically the Primary Site Collection administrator.  Also in Site Collection Admins.

July 30th, 2015 11:41am

Hi,

Please reinstall the SharePoint Online Management Shell:

https://www.microsoft.com/en-us/download/details.aspx?id=35588

And please run the PowerShell script under Tenant Administrator permission instead of site collection administration permission.

Feel freely to reply if there is any update.

Best Regards,

Dean Wang

Free Windows Admin Tool Kit Click here and download it now
August 4th, 2015 8:56am

And please run the PowerShell script under Tenant Administrator permission instead of site collection administration permission.

Hi Dean,

Thanks for the reply.  Reinstalling the SharePoint Online Management Shell didn't have any obvious positive effect; I add to replace the line:

add-type -Path $programFiles'\SharePoint Online Management Shell\' + `
  'Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll'


with an absolute path:

add-type -Path 'C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll'

to get it to work. 

But running the script (with the try block replaced with line-by-line) yields the same result:

PS C:\Windows\system32> $sideLoadingGuid = new-object System.Guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D"
PS C:\Windows\system32> $site.Features.Add($sideLoadingGuid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]
::None);

DefinitionId       :
DisplayName        :
Context            : Microsoft.SharePoint.Client.ClientContext
Tag                :
Path               : Microsoft.SharePoint.Client.ObjectPathMethod
ObjectVersion      :
ServerObjectIsNull :
TypedObject        : Microsoft.SharePoint.Client.Feature

PS C:\Windows\system32>         $cc.ExecuteQuery();
Exception calling "ExecuteQuery" with "0" argument(s): "The remote server returned an error: (403) Forbidden."
At line:1 char:9
+         $cc.ExecuteQuery();
+         ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

If you read my recently clarified original post, I'm not using two account; my only account (Simon Carroll) is both a tenant administrator and the primary site collection administrator. 

August 5th, 2015 9:33am

Hi,

I ran the command again in my environment and it worked fine.

Whats the site template in your environment and I would have a try to reproduce the error.

Please create a team site and test whether the error occurs.

Please have a try to do this from SharePoint Management Shell by:

Enable-SPFeature e374875e-06b6-11e0-b0fa-57f5dfd72085 url http://sp.contoso.com

Best Regards,

Dean Wang

Free Windows Admin Tool Kit Click here and download it now
August 6th, 2015 10:20am

Hi Dean,

I think you're missing a pretty huge piece of the puzzle here.  This is SharePoint Online, there is no enable-spfeature cmdlet.  Please see my first post title.  Also, all the connect-sposervice and credential loading stuff..

Forgetting that for a moment, my first site and second sites were Team sites, and the third and fourth were Developer sites (on which we didn't need to enable Sideloading, as it's already there).  I've created a new Team site now, see screenshot.  Same situation.  I've added a simple output of the $CC variable to show what's stored. 

Creating a new Team Site

Powershell output for new Team site

August 6th, 2015 2:24pm

Hi Simon,

Since Im unable to reproduce your issue, it would be helpful to provide more details in logs for us to resolve your issue.

As the ULS logs of SharePoint Online is managed at the backend by Office 365 which is not accessible from client side, I suggest you contact Office 365 for business support to request the logs with the specific Correlation ID:

https://support.office.com/en-us/article/Contact-Office-365-for-business-support-32a17ca7-6fa0-4870-8a8d-e25ba4ccfd4b

Best Regards,

Dean Wang

Free Windows Admin Tool Kit Click here and download it now
August 11th, 2015 3:39am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics