Configure and Create App in SharePoint 2013

As we know SharePoint 2013 has introduced an App Model approach and everyone is eager to develop the app. Using this article, I am explaining the procedure to include App configuration as well as App development.

Section 1: Configuring App in SharePoint 2013

  1. Create DNS entry for App

    Go to Administrative Tools then click on "DNS":

    ShrApp1.jpg

    See the following screen:

    ShrApp2.jpg

    Right-click then select "Create New Alias(CName)". Refer to the following screen:

    ShrApp3.jpg

    Select "same as parent" as in the following screen:

    ShrApp4.jpg

    Your final screen should be as in the following, click "Ok":

    ShrApp5.jpg
     
  2. DisableLoopbackCheck in regedit (to avoid authentication prompt)

    Open the Registry window:

    ShrApp6.jpg

    Go to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" and right-click and select:

    ShrApp7.jpg

    Rename "DisableLoopbackCheck" and right-click on "modify" and change the value to "1". The final output should look as in the following:

    ShrApp8.jpg
     
  3. Check timer job to check spadmin & sptimer services

    PowerShell script:
    net start spadminv4
    net start sptimerv4
     
  4. Set App Domain

    PowerShell script:
    Set-SPAppDomain "<Domain name>"
     
  5. Check Appservices and Subscription services

    PowerShell script:

    Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance
    And ensure service:
    Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"}
     
  6. Configuring SPSubscriptionService

    PowerShell script:
    $account = Get-SPManagedAccount "<Farm Account>"
    $appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool –Account$account
    $appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
    $appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName SettingsServiceDB
    $proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc
     
  7. Configure AppManagement ServiceInstance

    PowerShell script:
    $appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName AppServiceDB
    $proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
    After performing step 6 and 7, In Central Administration site go to Application Management -> Manage Service Applications. You will able to see:

    ShrApp9.jpg
     
  8. Configure tenant for hosting SharePoint 2013 Apps

    PowerShell script:
    Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false
     
  9. Configure App URL in Central Administration

    In Central Administration site go to "Apps" -> "Configure App Url's":
    ShrApp10.jpg

Section 2: Develop SharePoint Hosted App using VS2012

After completing Section 1 of this article, we are ready for creating apps in SharePoint 2013. I will explain the procedure for creating a hello world app in SharePoint 2013.

  1. Open Visual Studio 2012, create a new project then select the language C# then the template "SharePoint Apps". Give it the name "HellowWorldApp". Click "Ok".

    ShrApp11.jpg
     
  2. Select "SharePoint Hosted App" and click on "Finish":

    ShrApp12.jpg
     
  3. The folder structure should look as in the following:

    ShrApp13.jpg
     
  4. Click on "Scripts\App.js". Add some text in it as in the following:

    ShrApp14.jpg
     
  5. Click on "Deploy" to deploy the solution. You are done with your first SharePoint 2013 App.

Section 3: Verify your app

  1. Open the site where your App is deployed. For example "Team Site". Click on "Site Action" - "Site Contents":

    ShrApp15.jpg
     
  2. Under Site Content, you will able to see the app you created, "HellowWorldApp". Click on "HellowWorldApp".

    ShrApp16.jpg
     
  3. Here is my app:

    ShrApp17.jpg

You can learn more about the basics of Apps from the MSDN link:

http://msdn.microsoft.com/en-us/library/fp179930.aspx

Hope you liked my Article... happy Learning.

 

Up Next
    Ebook Download
    View all
    Learn
    View all