SharePoint 2013 - You receive "Sorry, apps are turned off. If you know who runs the server, tell them to enable apps" when trying to add Apps on Host Header site collection

 

Issue

I recently worked on a case where customer was facing issue when trying to add Apps on Host Header Site collection. He does not face any issues while trying to add apps on site collection created without host header mode.

Repro

Here are the steps to reproduce the issue, these steps can also help you in configuring HH mode site collection in case you were not sure on how to do it :) (These steps will also work on SharePoint 2007)

1. Create a New web application, In my case it is https://sps2013-a.com

2. $Sub = New-SPSiteSubscription (This cmmdlet will help in generating new SPSite Subscription)

3. New-SPSite https://test.walia.com -OwnerAlias walia\administrator -HostHeaderWebApplication https://sps2013-a -language 1033 -sitesubscription $sub

The above command will create a new Site collection in HH mode and assign a unique subscription ID(We generated this ID in Step 2)

4. new-spsite -url https://sps2013-a/sites/tadminsite -template TENANTADMIN#0 -owneralias walia\administrator -AdministrationSiteType tenantadministration -language 1033 -sitesubscription $sub

(The above command will create a new Tenant Administration site and will tie the HH mode site collection to it,We assign it the same Subscription ID of the HH mode site)

5) Browse to the Site https://test1.walia.com

6) Click on Site Contents and try to add App from App Store

You will receive "Sorry, apps are turned off. If you know who runs the server, tell them to enable apps"

Data Analysis

Following message is logged in ULS logs

01/02/2013 15:42:10.29        w3wp.exe (0x0A0C)        0x03E0        SharePoint Foundation        App Deployment        adysh        High        The site subscription name for site https://test.walia.com does not exist. The site subscription name must exist to complete this operation.        19fdf09b-7152-3086-ee69-b85fa6faa86c

Resolution

1) Browse to Tenant Administration Site of the HH mode Site collection

2) Create App Catalog for Tenant by clicking on Manage App Catalog

image

Note – Every Tenant Admin will require a App Catalog(Make sure Self site creation is enabled in order for App Catalog to get created)

3) $Sub = Get-SPSiteSubscription https://hhmodeSite (This CMDlet will help in fetching the subscription ID of the HH mode site collection)

Set-SPAppSiteSubscriptionName -Name "Name for Subscription" -SiteSubscription $Sub

We need to run the above command in order to set the unique name for domain under which these apps will run.More details can be found under https://technet.microsoft.com/en-us/library/jj219503.aspx

 

Feel free to post comments if you have any confusion regarding any of the steps.

Comments

  • Anonymous
    January 01, 2003
    -Name can be anything

  • Anonymous
    January 13, 2013
    Nice work by you can your team Harmeet

  • Anonymous
    March 25, 2013
    Hello, Did you create app catatalog for every tenant ? or it's possible to have one for all, like http://hhmodesite/apps for example ? Thanks !

  • Anonymous
    March 26, 2013
    For : Set-SPAppSiteSubscriptionName -Name "Name for Subscription" -SiteSubscription $Sub You perform this command for one tenant but for other ?

  • Anonymous
    May 03, 2013
    What doesn't appear to be clear in any documentation released by Microsoft is the value for the actual -Name parm when setting the Set-SPAppSiteSubscriptionName. Can this be any unique name for each tenant or does it somehow have to relate to something generated when the subscription is created? thanks for any help

  • Anonymous
    November 12, 2013
    The comment has been removed

  • Anonymous
    March 08, 2015
    Parmjit kumar

  • Anonymous
    June 23, 2015
    Hi, How do you get to the Tenant Administration?

  • Anonymous
    November 17, 2015
    If I just want to see the apps that Sharepoint already has do I need to create an app domain and do all of those steps? We arent' developing apps just want to use what Sharepoint already has? We are using Sharepoint Foundations 2013 is this function possible?

  • Anonymous
    December 04, 2015
    Jessie, Won't work for Foundation. Here is where you can find the apps https://store.office.com/appshome.aspx?productgroup=SharePoint