Continuing from where we left in part 1

Create an isolated domain on your development computer.

  1. Ensure that the spadmin and sptimer services are running by opening a command prompt and typing the following commands.

    • net start spadminv4
    • net start sptimerv4
  2. Create your isolated add-in domain by running the SharePoint Management Shell as an administrator and typing the following command. Replace the contosoapps.com with your add-in domain. It should not be a subdomain of the host SharePoint domain. Doing so largely defeats the security advantages of having isolated add-in domains. For example, if the host domain is contoso.com, do not use apps.contoso.com as the add-in domain.

    • Set-SPAppDomain "ravibaggam.com"
    • Note: I used [VDEname]-apps.com:
    • Set-SPAppDomain "ravibaggam-apps.com"
  3. Ensure that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running by typing the following command in the SharePoint Management Shell.
    Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance
  4. Verify that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running by typing the following command in the SharePoint Management Shell. The output will indicate whether each service is online.
    • Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"}
    • Note: You can check to see if a managed account exists for your user name, and if so skip step 5 below. 
    • Get-SPManagedAccount "lm\nXXXXXXX"
  5. You must specify an account under which the SPSubscriptionService and AppManagementServiceInstance service instances will run. This account must be an SPManagedAccount. You can create an SPManagedAccount by typing the following command in the SharePoint Management Shell. (You’ll be prompted for the account domain\user and password.)
    • $account = New-SPManagedAccount
  6. Specify an account, application pool, and database settings for the SPSubscriptionService and AppManagementServiceInstance services by typing the following code in the SharePoint Management Shell. If you created a SPManagedAccount in the preceding step, use that account name here.

    • $account = Get-SPManagedAccount "lm\nXXXXXXX"
      $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
      $appAppSvc = New-SPAppManagementServiceApplication –ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName AppServiceDB
      $proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
  7. Specify your add-in prefix by typing the following code in the SharePoint Management Shell.

    • Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false
    • Note: If you get an error on step 7, it is most likely because you are low on memory. Close all other programs and try again.  If that fails, reboot and try again.