Setting up Add-In development environment in sharepoint server 2016

create sharepoint hosted add in sharepoint 2016 visual studio 2017
InfoPath alternatives for form designing SharePoint

Here in this SharePoint 2016 article we will discuss how to configure sharepoint add-ins development environment and create a simple hello world web part in sharepoint server 2016 on-premises.

Let us first discuss about 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.

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

 

 

Next step create wildcard alias name CNAME in your new domain
Right click on the forward look zone created -> click New Alias CNAME

 sharepoint 2016 development environment

sharepoint 2016 development environment

sharepoint 2016 development environment requirements

In the wizard Provide Alias name as “*”
Now your FQDN look 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

 

Also read SharePoint tutorials:
– Communication Site Overview in SharePoint online Office 365

– SharePoint Online communication site Hero webpart

– Change the SharePoint List View into JQuery News Ticker Using JS Link CSR

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 check the app management service and subscription settings service are in running state
Open sharepoint 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

sorry apps are turned off sharepoint 2016

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

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
Open sharepoint central administration-> Click Apps -> App management -> Configure App URLs

  Configure an environment for apps for SharePoint Server

Configure an environment for apps for SharePoint Server

Provide the App Domain and App Prefix

Sharepoint 2016 APPS not enabled
Sharepoint 2016 APPS not enabled

Click Ok
Open visual studio -> New project -> Pick a template sharepoint add-in

How to enable apps in SharePoint 2016
How to enable apps in SharePoint 2016

 

Click Ok
Choose the add-in type sharepoint hosted or provider hosted addin
– Sharepoint Hosted Addin -> It’s hosted inside the sharepoint farm
– Provider hosted addin -> It deploy the contents and host outside of sharepoint like any web servers and azure websites.

In this demo I have choose sharepoint hosted addin -> click Next

 sharepoint 2016 app development

sharepoint 2016 app development

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 add-in project look like this

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

– Content -> Holds the style sheets by default it uses App.css
– Images -> This module helps to store the images inside your project
– Pages -> This module helps to holds 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 with out deleting
– Package – Helps to package your app modules into 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 user name 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 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 addin.

sharepoint 2016 app development step by step
sharepoint 2016 app development step by step

Now you know how to setting up sharepoint addin development environment and create a project into it.
We discuss more in my upcoming articles,

Happy sharepointing !!!!

Similar SharePoint 2013 Tutorials


Leave a Reply