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:
- 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:
- 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:
- 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:
- $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”
- $appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
- $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
- $proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc
- $account = Get-SPManagedAccount “<farm account>”
- 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:
- $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”
- $appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
- $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
- $proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
- $account = Get-SPManagedAccount “<farm account>”
- 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:
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):
- 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:
- 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:
- Open the registry editor (regedit.exe)
- Browse to the following path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
- Add a new Multi-String Value and call it: BackConnectionHostNames
- Edit the value and enter *.gauravmahajan.net and gauravmahajan.net in two different lines:
- Close the registry editor and restart the machine
- Browse to your app again and it should now open just fine after you provide the required credentials.
- 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!
Pingback: Sharepoint 2013: Get Me Out Of Here (Part I): Full Trust Proxy « Cloud2013 Or Bust
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.
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
thanks i have being searching for the 401.1 solution from a long time
Thanks Arpan! Glad I could help!
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
Hello Samer,
Thank you for your kind words. I have not captured the installation steps since there are a lot available online. As far as the training resources go, here are a few:
http://technet.microsoft.com/en-us/sharepoint/fp142374.aspx
http://office.microsoft.com/en-us/sharepoint-help/training-courses-for-sharepoint-2013-HA104030990.aspx
http://msdn.microsoft.com/en-us/sharepoint/fp123633(v=msdn.10).aspx
http://technet.microsoft.com/en-us/sharepoint/fp123606.aspx
http://channel9.msdn.com/search?term=Sharepoint+2013
Hope the above help
Thanks!
Pingback: SharePoint 2013 App Deployment | SharePoint, .NET and SQL Development
Pingback: setup SharePoint ‘app’ environment | nxg4274
Pingback: SharePoint 2013 Hosted App (Part 1) – Configure Apps for SharePoint 2013 | Tjen Sharepoint Blog
Reblogged this on Mai Omar Desouki – Avid SharePointer.
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
Hi Tom
Thank you for your kind feedback! Sorry, unfortunately I have not tried the OneNote side of things.
Regards
Gaurav