In this article, let us see, how to prepare the SharePoint 2013 development environment for the App Development with a sample of a SharePoint Hosted Application. Before creating a SharePoint hosted app, we need to make sure that certain activities are done. Let us see them step by step.
By this time, there are a lot of articles regarding the App development Model in SharePoint 2013. But even then, we will also discuss about them for our understanding and comfort.
As usual, let us go by the order in which the things needs to be done before open our visual studio for the first SharePoint Hosted App.
1. Make sure the Services are running.
a. There are 2 services which needs to be ran for SharePoint Apps to get executed.
- SharePoint Administration Service
- SharePoint Timer Service
b. To verify them, we can go to the Services.msc.
c. The same can be done by command prompt also. Open the command prompt as Administrator and type the following commands.
- Net start spadminv4
- Net start sptimerv4
2. Make sure the following Service Applications are running.
a. There are 2 service applications and the services on the SharePoint server needs to be ran.
i. App Management Service Application
ii. Subscription Settings Service Application
b. For that, we need to create Service Application for these 2. For App Management Service Application, we can go with the Central Administration. But considering the Subscription Settings, we need to go with only PowerShell. Hence, we will go with the PowerShell for both the option first. Follow the steps in the PowerShell IDE.
i. Create a Managed Account.
ii. Create an Application Pool, Database for the above mentioned 2 Service Application.
iii. Create the Service Application and Service Application Proxy.
iv. Make sure that these 2 service applications are running.
c. Let us see the steps with the power shell first.
# Create a Managed Account $account = New-SPManagedAccount # Get the same Managed Account $account = Get-SPManagedAccount "domainuser" (ex : SS.LocAdministrator) # Create a App Pool or Subscription service $appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account # Create a App Pool for App management Service $appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account # Create a Service Applications $appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName SettingsServiceDB $proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc $appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName AppServiceDB $proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
d. This will Create the Service Applications. To verify them, run the following commands.
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"}
e. The same can be verified through the Central Administration also.
3. Create an App-Prefix.
a. PowerShell Script
Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false
b. Central Administration
4. Setting the AppDomain for the SharePoint 2013 Apps.
Creating either a new subdomain or creating a CNAME alone will do this. There are already many articles related to this and even if it requires, we can go with a separate article for this. Because it will deviate from our main topic.
Once, the AppDomain is created, map it on the Central Administration.
With this, we are good to go with the SharePoint Hosted Apps. With the above mentioned settings, we can go with the App Development Model. Let us see, how to create a SharePoint Hosted Application in the coming articles. Thanks.
Regards,
Sathish Nadarajan.
Leave a comment