Step by Step How to configure environment for SharePoint app development


With the new app model introduced with SharePoint 2013, to enable developers to build their SharePoint apps, you need to configure a SharePoint environment for app development.

The step required to prepare your environment are:

  1. Determine the app domain.
  2. Configure app domain in your DNS server.
  3. Create a wildcard SSL certificate for the app domain.
  4. Start Subscription Settings and App Management service applications.
  5. Configure the Subscription Settings service application.
  6. Configure the App Management service application.

Determine the app domain

The first step is to create an isolated domain on the developer workstation where your apps for SharePoint will run.

This domain should be a URL namespace that you reserve as a namespace for organizing apps. You have the option to create a new unique domain such as contosoapps.com or create a sub-domain of the existing domain such as apps.contoso.com.

For security reason is recommended to create a new unique domain. This because the use of a sub-domain could lead to cookie attacks on other non-SharePoint Web based applications in the same domain namespace.

So when a SharePoint app is provisioned, it has a URL that looks like this:

http[s]://Apps12345678ABCDEF.ContosoApps.com/Sites/Dev/Myapp

Where:

  • Apps – is the app prefix or tenant name
  • 12345678ABCDEF – is a unique identifier that is arbitrarily assigned to each app instance
  • ContosoApps.com – is the app domain
  • Sites/Dev – is the host web
  • Myapp – is the app name
Before the March 2013 Public Update for SharePoint 2013, you could only host one app domain and it had to be in the Default zone. The Public Update enables you to configure an app domain for each web application zone and use alternate access mapping and host-header web application configuration. For more information, see Enable apps in AAM or host-header environments for SharePoint 2013.

Configure app domain in your DNS server

Once you have determinated yor app domain, you need to configure it in your DNS.

First, create a new forward lookup zone:

dnsfwlookup1
dnsfwlookup7
dnsfwlookup3
dnsfwlookup4
dnsfwlookup5
dnsfwlookup6
dnsfwlookup2

Then create a wildcard alias record (CNAME) for the DNS domain name that allows for individual apps to create unique domain names within your app domain.

dnswildcard1

In the Fully qualified domain name (FQDN) for target host box, insert the domain name of the target that hosts your SharePoint sites.

dnswildcard2

To verify new domain name type ping Apps-12345678ABCDEF.contosoapps.com in a Command Prompt.

Create a wildcard SSL certificate for the app domain.

Now, if you are using Secure Sockets Layer (SSL) for the SharePoint sites in your environment, or if you plan to use apps that use data external to the SharePoint sites, you should use SSL for your apps.

To use SSL, you need to create a wildcard SSL certificate (ex.: *.ContosoApps.com) for your app domain because each installed app has its own subdomain.

I don’t provide detailed steps to do this because it depends if you plan to request a certificate to your internal CA or if you plan to create a Self-Signed certificate.

Start Subscription Settings and App Management service applications.

SharePoint Apps rely on the App Management and Microsoft SharePoint Foundation Subscription Settings service applications.

So you need ensure the following services are running in your farm:

  • App Management Service
  • Microsoft SharePoint Foundation Subscription Settings Service

You can start this services by using the Central Administration:

spservices1spservices2

Alternatively, you can use the following PowerShell cmdlets:

> $service = Get-SPServiceInstance | where{$_.GetType().Name -eq   “AppManagementServiceInstance”

> Start-SPServiceInstance $service.Id> $service = Get-SPServiceInstance | where{$_.GetType().Name -eq “SPSubscriptionSettingsServiceInstance”}

> Start-SPServiceInstance $service.Id

Configure the Subscription Settings service application.

Next step is to create the Subscription Settings service application you have to execute some PowerShell cmdlets.

Before to start ensure do you have a managed account under which the SPSubscriptionService and AppManagementServiceInstance service instances will run.

> $account = Get-SPManagedAccount “domain\user”

> $appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account

> $appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name “Settings Service Application” –DatabaseName “SharePoint_SettingsService”

> $proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc

Configure the App Management service application.

Now is time to create the App Management service application. You can do this step by using the Central Administration or by executing some PowerShell cmdlets. I show how to create the App Management service application by using PowerShell cmdlets:

> $appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account

> $appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name “App Management Service Application” -DatabaseName “SharePoint_App_Management”

> $proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc

Last step, you need to configure App settings to specify the app domain and the app prefix you will use.

You can do this by using the Central Administration:

configapps1configapps2

Or via PowerShell cmdlets:

> Set-SPAppDomain <appDomain>

> Set-SPAppSiteSubscriptionName -Name “apps” -Confirm:$false

Summary

As shown in this article, the new app model requires some additional configurations on your environment to allow you to start a development process for your SharePoint apps. I hope this article provides you an understand of what you need and how to configure your development environment.

References

Configure an environment for apps for SharePoint

http://technet.microsoft.com/en-us/library/fp161236.aspx

How to: Set up an on-premises development environment for apps for SharePoint

http://msdn.microsoft.com/en-us/library/fp179923

How To Configure SharePoint 2013 On-Premises Deployments for Apps

http://blogs.technet.com/b/mspfe/archive/2013/01/31/configuring-sharepoint-on-premise-deployments-for-apps.aspx
Advertisements
Tagged with: ,
Posted in SharePoint
3 comments on “Step by Step How to configure environment for SharePoint app development
  1. sivaprakashv says:

    Hi

    i Need to install the Sharepoint App in On premise Machine for a HTTPS Site. I have installed successfully for normal(http://) webapplication. facing problem with Https site..Could you pls tell me how to create a wild card ssl and binding for our sharepoint site.?

    • gianespo says:

      Hi,

      to configure apps with HTTPS you need to create a wildcard SSL certificate for your app domain (ex.: *.ContosoApps.com), you can do it from Internet Information Sevices (IIS) Manager in the “Server Certificates” page of your computer.
      For production environment you need a certificate issued by a Trusted Certification Autority, for test or lab environment you could use a Self-Signed Certificate.

      In the instructions provided in my post, I used a routing web application to route requests for *.contosoapps.com to the right web application as described in this post: http://blogs.technet.com/b/mspfe/archive/2013/01/31/configuring-sharepoint-on-premise-deployments-for-apps.aspx

      After you have the wildcard certificate installed on your SharePoint machine, you need to bind it to the web site for your web application from IIS. Later you need to trust the wildcard certificate or the CA certificate in your SharePoint farm (Central Administration > Security > Manage Trust) and finally change the Alternate Access Mapping to ensure the SharePoint site is binded to HTTPS.
      However you have to configure with SSL also the web appliation where you use the apps.

      As sample you can check this post to understand how to configure the SSL for SharePoint: http://blogs.msdn.com/b/fabdulwahab/archive/2013/01/21/configure-ssl-for-sharepoint-2013.aspx

      I hope this could help you.

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

%d bloggers like this: