1

I am quite new to Sharepoint Apps.

Following the below steps, have created a SharePoint hosted App in SP 2016 on premise farm;


Configuring an “on-premise” development environment for Apps for SharePoint

Step 1: Create an Isolated App Domain

If you want to create and deploy SharePoint Hosted apps, you must create an isolated app domain where your apps for SharePoint will run. 1. Start the SharePoint 2013 Management Shell.

• net start spadminv4 • net start sptimerv4

  1. Create your isolated app domain your apps, for example "apps.practise.com".

• Set-SPAppDomain "apps.practise.com"

  1. Ensure that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running.

Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance
  1. Verify that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running.

Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"}
  1. You must specify a farm admin account under which the SPSubscriptionService and AppManagementServiceInstance services will run. This farm admin account must be an SPManagedAccount. If your farm admin is not an SPManagedAccount, you can create a SPManagedAccount with your farm admin credentials by typing the following command in the SharePoint Management Shell (You will be prompted for the farm admin domain\user and password).

$account = New-SPManagedAccount
  1. Specify a farm admin account, application pool, and database settings for the SPSubscriptionService and AppManagementServiceInstance services.

$account = Get-SPManagedAccount "domain\username" $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

Step 2: Start the Required Services

To verify this, click Start -> point to Administrative Tools -> and then click Services. In the Services list, verify that the SharePoint Administration and SharePoint Timer services are running. For apps to work, you need to have the App Management and Subscriptions Settings Service Applications configured. Before creating these service applications verify that the following services are running in the Manage Services on Server page. • App Management Service • Microsoft SharePoint Foundation Subscription Settings service You can verify the same from the Services on Server page in central admin.

Step 3: Configure App URLs

To configure App URLs using Central Admin, follow the below mentioned steps. • In Central Admin, click on Apps. • In Apps page, click on Configure App URLs. • In the App domain box, type the app domain that was created earlier for hosting apps. In our case we have used app.practice.com. • In the App Prefix box, type a name to use for the URL prefix for the apps. • Click OK.

• Open Visual Studio 2013 instance and select App for SharePoint 2013 template to create the project. • Select SharePoint-hosted as the hosting platform for our app. • Put the site collection URL on which we want to deploy app. (Site collection template should be developer site). • Here App.js file is our main JavaScript file where the entire logic is there and default.aspx is the landing page of the app where we will reference the App.js file. • If you look at the App.js file, by default some logic is written there. It is fetching the current logged in user’s name and displaying that. Let us keep it same and not add any business logic here and try deploying this app. • Right click on the project name and deploy. You might encounter below errors.

Error 1: “Error occurred in deployment step ‘Install app for SharePoint’: The System Account cannot perform this action.” SharePoint will not allow you to install nor uninstall apps using the farm account (System Account). If you try to deploy your app using Visual Studio F5 you will get one of the following errors if you do it using System Account: Solution: Now try to log in into the machine using some other account and try to install the app. You might receive the following error.

Error 2: "Error occurred in deployment step "Installed app for SharePoint": The local SharePoint server is not available. Check that the server is running and connected to the SharePoint Farm" Solution: To resolve the above error login using system account and open the SQL server management studio and assign the db_owner permissions to the account which you are using to deploy the app for below databases. • SharePoint_Config • SharePoint_Admin_ [GUID] • Current web application content database that needs to host the app • App management service application database • Subscription Settings service application database (Optional)

Now try to deploy the App. App will be successfully deployed.

The deployed App is showing in Website content. However on click of app name a blank page gets generated.

Kindly let know what i am missing.

  • Have moved ahead In AppManifest > Permissions tab > gave Web scope - full control now page loads after entering credentials. I got the page which prompts'Do you trust appname? I clicked on 'Trust It' But now it prompts for login 3 times after click of 'Trust it' button. I entered the required creds 3 times. After that is shows blank page. Kindly suggested what settings i am missing – shoab Sep 19 '17 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.