Configure Apps for SharePoint 2013

Microsoft has published a very comprehensive set of guidelines for installing, configuring and managing Apps for SharePoint 2013. These guidelines are available on the TechNet site here: http://technet.microsoft.com/en-us/library/fp161232.aspx. Without duplicating those details however, I wanted to capture the few necessary steps for those who wanted to quickly get apps for SharePoint 2013 going on a dev. farm. Please note that the examples assume you are using the VM downloaded from my earlier blog post:

  1. Configure DNS entries: First a little background on why we need to do this – Each installation of an app has a unique URL in your environment. You determine the template for that URL (by determining a domain name and an app prefix), and then app URLs are automatically generated based on that template. Paths for the apps are based on the URL for the site where they are installed. When you install an app to a site, a SubWeb of that site is created to host the app content. The SubWeb for the app is hierarchically below the site collection, but has an isolated unique host header instead of being under the site’s URL. It is recommended to configure a separate DNS for your apps. The difference in domain names provides a layer of isolation for the apps. The use of a different domain name from the SharePoint sites prevents cross-site scripting between the apps and sites and unauthorized access to users’ data. Once you have configured the DNS, you will want to create a wildcard DNS so any app URLs that SharePoint creates can be serviced. The screen shot below shows a “*.apps” wildcard CNAME record:
    DNS
  2. Enable Services on the server: Browse to “Central Administration –> System Settings –> Manage Services on server” and ensure that the “App Management Service” and “Microsoft SharePoint Foundation Subscription Settings Service” services are started:
    Services
  3. Configure the Subscription Settings service application and proxy:  You can do so by running the following commands in the SharePoint 2013 Management Shell (PowerShell) – examples below assume you are using the VM downloaded through my blog post:
    1. $account = Get-SPManagedAccount “<farm account>”
      • Where: <farm account> is the name of the Farm administrators account in the SharePoint farm
      • Example: $account = Get-SPManagedAccount “sp_farm”
    2. $appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
    3. $appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName <SettingsServiceDB>
      • Where: <SettingsServiceDB> is the name that you’d like to give to the new Subscription Settings Service database that the above command will create
      • Example: $appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName App_SubscriptionSettingsService
    4. $proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc
  4. Configure the App Management service application and proxy:  You can do so by running the following commands in  SharePoint 2013 Management Shell (PowerShell) – again, examples below assume you are using the VM downloaded through my blog post:
    1. $account = Get-SPManagedAccount “<farm account>”
      • Where: <farm account> is the name of the Farm administrators account in the SharePoint farm
      • Example: $account = Get-SPManagedAccount “sp_farm”
    2. $appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
    3. $appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName <AppServiceDB>
      • Where: <AppServiceDB> is the name that you’d like to give to the new App Management Service database that the above command will create
      • Example: $appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName App_AppManagmentService
    4. $proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
  5. Configure the app URLs in Central Admin: Browse to “Central Administration –> Apps –> Configure App URLs” and enter the wildcard CNAME entry that you created above (in step 1) along with an app prefix as depicted below:
    APP URLs

That’s all you would need to do to get started. Now, a few issues that I faced in my environment (and how to overcome them):

  1. Access denied error when trying to configure the Subscription Settings service application: You are most likely going to face this issue if you are using the VM created by me. The underlying cause for this issue is that for some reason, the SQL server installation did not configure permissions correctly on the “Data” directory. This results in a failure when PowerShell tries to create the database for the service application. To overcome the issue you will manually need to grant the “SQLServerMSASUser$SP2013$MSSQLSERVER” Read and Write access to the data directory:
    DataDirectoryPermissions
  2. 401.1 error: The second issue that I faced was the http 401.1 error that I received after adding an app from the SharePoint App Store and browsing to this newly added app. There are 2 workarounds for this issue that Microsoft describes in this KB article. I am going to duplicate the recommended approach described in this KB:
    1. Open the registry editor (regedit.exe)
    2. Browse to the following path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
    3. Add a new Multi-String Value and call it: BackConnectionHostNames
    4. Edit the value and enter *.gauravmahajan.net and gauravmahajan.net in two different lines:
      BackConnection
    5. Close the registry editor and restart the machine
    6. Browse to your app again and it should now open just fine after you provide the required credentials.
    7. In case the above does not work, you may want to go for the second workaround described in the KB (but only in non-production environments)

Hope the above helps you in getting a quick start on using Apps for SharePoint 2013!

Advertisements
This entry was posted in How To, SharePoint, SharePoint 2013 and tagged , . Bookmark the permalink.

14 Responses to Configure Apps for SharePoint 2013

  1. Pingback: Sharepoint 2013: Get Me Out Of Here (Part I): Full Trust Proxy « Cloud2013 Or Bust

  2. kamil says:

    Hi,

    I’m using your VM machine and it’s great:) But I have problems running apps on it. I was able to deploy the app, but I can’t run it.
    First approach is not to set the proxy in IE(I need proxy to connect to the internet). When I try to run app I’m getting: “This page can’t be displayed”. Is it necessary to have the conection to the Internet to run apps, other sharepoint stuf works without it?
    Secound approach is using proxy, but when I click on the app to run it, it redirect me to address http://gauravmahajan.net

    Do you have any suggestions what can I do.

    In proxy setting I’m using automatic configuration srcipt and I can not exclude using proxy for local adresses.

    • kamil says:

      It the third approach I’m using proxy server adress and I can exclude local adresses: sp2013*;gauravmahajan*. But it this case I get “This page can’t be displayed”

      • Hi Kamil,
        The fact that it’s taking you to gauravmahajan.net most likely means that the loopback check is not configured or working correctly. Have you carried out the troubleshooting Step 2 from the post above? If so, I will also recommend trying the alternate approach from the KB article. You can also disable the strict name checking as described in Bob Fox’s blog here: http://blogs.technet.com/b/sharepoint_foxhole/archive/2010/06/21/disableloopbackcheck-lets-do-it-the-right-way.aspx. Also, before deploying our own app, the first thing you would want to verify is if the services have been configured correctly. You can do so by simply browsing to the app store (you will need an internet connection for that) from your site collection and installing in one of your site collections, a simple app such as the Bamboo “World Clock and Weather” app or the one of the free news apps. That will tell you if the apps have been configured correctly. If the above steps succeeds, you will want to look at the SharePoint log files to see the error details.
        I hope the above helps! If however the above does not resolve the issue or help you troubleshoot better, I can also try and help you if you can email me the error log and/ or the code for the app if you can.
        Thanks
        Gaurav

  3. Arpan says:

    thanks i have being searching for the 401.1 solution from a long time

  4. Samer says:

    Hi Gaurav. First I would like to thank you for your blogs and the VM, i have two requests, one I have downloaded the vm you have created, and it is awesome, do you have a detailed installation steps?
    can you also guide me if there is any hands-on labs, I would like to to be an expert on 2013, many thanks in advance

  5. Pingback: SharePoint 2013 App Deployment | SharePoint, .NET and SQL Development

  6. Pingback: setup SharePoint ‘app’ environment | nxg4274

  7. Pingback: SharePoint 2013 Hosted App (Part 1) – Configure Apps for SharePoint 2013 | Tjen Sharepoint Blog

  8. Tom says:

    Dear Gaurav,
    thanks for the great work here. I have run in in VMware workstation. The file upload&download works in host pc however I could not get onenote sync notebooks.
    Have you tried this ?
    BR,
    Tom

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s