SharePoint development Training

Set up an On-Premise development environment for SharePoint Add-in or Apps developement in SharePoint 2016/2013

create sharepoint hosted add in sharepoint 2016 visual studio 2017

This SharePoint 2016 tutorial explains how to set up an On-Premise development environment for SharePoint Add-in or Apps development in SharePoint 2016/2013. And also we will discuss how to create a hello world SharePoint hosted add-in in SharePoint 2016 on-premise environment.

Let us first discuss what are the things required for setting up SharePoint add-in development environment.


  • Create a Forward Lookup Zone
  • Create a CName alias
  • Configure App management service
  • Configure Microsoft Subscription Setting Service
  • Configure App URLs

If you are new to SharePoint 2016, then you can read SharePoint 2016 installation steps (FREE PDF Guide) and SharePoint 2016 new features.

Create Forward Lookup Zone

First, we will see how we can create forward lookup zone, Open DNS to create a forward lookup zone in your Domain
Click Start -> DNS




configure add in environment for sharepoint 2016
configure add in environment for SharePoint 2016

On the window click on the SharePoint domain -> Click Forward lookup zone -> Create New

 sharepoint 2016 apps configuration step by step
SharePoint 2016 apps configuration step by step

In the New zone wizard -> Click Next -> use the primary zone as default

how to configure sharepoint 2013 on-premises deployments for apps
how to configure sharepoint 2013 on-premises deployments for apps

Click Next -> Pick All DNS Server running on the domain controller in this domain by default -> Click Next


 how to configure sharepoint 2016 on-premises deployments for apps

how to configure SharePoint 2016 on-premises deployments for apps

Provide the Zone name in my case I am created “SharepointApps.com” then click next

setup sharepoint 2013 app development environment
setup SharePoint 2013 app development environment

In the dynamic update, page accept as default -> Click next to complete the FLZ setup

setup sharepoint 2016 app development environment
setup SharePoint 2016 app development environment

Create a CName alias

To configure apps or add-in environment, Next step is to create wildcard alias name CNAME in your new domain.

Right click on the forward look zone created -> click New Alias CNAME

setup add in environment sharepoint add-ins on office 365 or SharePoint 2016
setup add in environment sharepoint add-ins on office 365 or SharePoint 2016

In the wizard Provide Alias name as “*”

Now your FQDN looks like this “*.apps.com”

Then click on the browse button to pick the target host of your domain

sharepoint 2016 app management service
sharepoint 2016 app management service

Click Ok to complete the process

enable apps sharepoint 2016
enable apps sharepoint 2016

Configure Subscription settings and App management service application

There service application used to provide the app permissions and create the subdomains for the app.

Before we proceed to check the app management service and subscription settings service are in running state

Open SharePoint 2013/2016 central administration -> Click Application management ->under service application ->Manage services in server

sorry apps are turned off sharepoint 2016
sorry apps are turned off SharePoint 2016

PowerShell to create Microsoft Subscription Settings Service Application

Use the below PowerShell cmdlet to create the Microsoft subscription settings service application



//Get the managed service account
$account = Get-SPManagedAccount “sharepoint20160\appservice”
//Create the new application pool for subscription settings service
$appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPoolA -Account $account
//Create subscription settings service application
$appSubSvc = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPoolSubSvc -Name SettingsServiceApp -DatabaseName MynewSubscriptionservice
//create proxy for the subscription settings service
$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $appSubSvc

PowerShell cmdlet to create App management service application

Use the below PowerShell cmdlet to create the App management service application
//Get the managed service account
$account = Get-SPManagedAccount “sharepoint20160\appservice”
//Create the new application pool for app
$appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account management service
//Create app management service application
$appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName MyappDb
//create proxy for the app management
$proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc service

You can also do the same from sharepoint central administration page to manage and create service application like App management service and subscription setting services

Configure App Service url in SharePoint central administration

Open SharePoint 2013/2016 central administration-> Click Apps -> App management -> Configure App URLs

 Configure an environment for apps for SharePoint Server
Set up an On-Premise development environment for SharePoint Add-in or Apps development in SharePoint 2016

Provide the App Domain and App Prefix

Sharepoint 2016 APPS not enabled
Sharepoint 2016 APPS not enabled

Click Ok.

Develop Hello World SharePoint Hosted Add-in

Now we will see ho we can develop our first SharePoint hosted add-in using visual studio 2015/2017 for SharePoint 2013/2016.

Open visual studio -> New project -> Pick a template SharePoint Add-in

How to enable apps in SharePoint 2016
Set up an On-Premise development environment for SharePoint Add-in or Apps development

Click Ok.

Choose the add-in type SharePoint hosted or provider hosted add-in

  • Sharepoint Hosted Add-in -> It’s hosted inside the SharePoint farm
  • Provider hosted add-in -> It deploys the contents and host outside of SharePoint like any web servers and azure websites.

In this demo I have chosen SharePoint hosted add-in -> click Next

 sharepoint 2016 app development
sharepoint 2013 development environment

Choose the add-in version “Sharepoint 2016”

create sharepoint hosted add-in sharepoint server 2016
create SharePoint hosted add-in SharePoint server 2016

Click Finish. After successful creation of the add-in project look like this

create add in sharepoint 2016 visual studio
sharepoint 2013 apps configuration step by step
create add in sharepoint 2016 visual studio 2017
setup SharePoint 2013 app development environment

Content -> Holds the stylesheets by default it uses App.css

Images -> This module helps to store the images inside your project

Pages -> This module helps to hold the pages inside your project.

Scripts -> This module help to hold your javascript files like jquery, Bootstrap references

Appmanifest.xml ->This file helps to manage the title, name, version, icon, permission and locale settings of the current add-in.

Feature -> This folder helps to include and exclude the modules in the project, For examples, you don’t need some modules you can just exclude without deleting

Package – Helps to package your app modules into a solution file. App

Click on the page module -> Open default.aspx

Under contentplaceholdermain replace the HTML below
<div>
<p id=”message”>
<!– The following content will be replaced with the username when you run the app – see App.js –>
Hello world
</p>
</div>
Click save -> Right click on the solution file -> click deploy it into SharePoint

create add in sharepoint 2016 visual studio 2015
create add-in SharePoint 2016 visual studio 2015

Open the SharePoint 2013/2016 site. Click on gear icon -> Click site contents

create sharepoint hosted add in sharepoint 2016 visual studio 2017
create SharePoint hosted add in SharePoint 2016 visual studio 2017

Now the app has been successfully installed in your site collection
Click on the HelloWorld SharePoint add-in.

sharepoint 2016 app development step by step
setup SharePoint 2016 app development environment

You may like following SharePoint 2013/2016/Online SharePoint Apps or Add-in tutorials:

Now you know how to set up a SharePoint add-in development environment and create a project into it. We discuss more in my upcoming articles.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope