How to Create State Service Application in SharePoint 2016?
Many components like InfoPath Form services, Visio, Search Service, workflows, etc., relies on the State Service Application of SharePoint to store the application sessions. If it’s not configured already, you’d probably see error messages such as:
“The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator.”
How to Create State Service Application in SharePoint 2016?
State service application can’t be created through the new service application page. If you go to the New dialog of Central Administration >> Manage Service Application page, you won’t find it! Here is how to create a state service application in SharePoint 2016.
- Go to Central Administration site >> Click on “Configuration Wizards” link from the bottom.
- In Configuration Wizards page >> click Launch the Farm Configuration Wizard link >> and then click “Start the Wizard”.
- On the services configuration page, under the Services applications section, select the State Service check box (select any other service applications you may require) and click Next.
- Click on Skip button if you setup a top-level site collection. If not, go ahead and create it now by clicking OK.
You can verify the new state service application by going to Central Administration > Application Management > Manage service applications >> State service application should be listed there!
Once you have created a state service application, make sure your new state service application is associated with your web application by going to Central Administration >> Manage Web Applications >> Select your web application >> Click on “Service Application Associations” from the ribbon >> and in “Configure Service Application Associations” page, State Services should be selected.
Disadvantage: Configuration wizard creates state service database with GUIDs! E.g. StateService_2349fb4359fb45c9a5255562cb0eab0b. So, to avoid GUIDs in the database, create the state service application using PowerShell:
SharePoint 2016: Create State Service Application using PowerShell
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Configuration variables
$ServiceAppName = "State Service Application"
$ServiceAppProxyName ="State Service Application"
$DatabaseName ="SP16_State_Service"
#Create New State Service application
$StateServiceApp = New-SPStateServiceApplication -Name $ServiceAppName
#Create Database for State Service App
$Database = New-SPStateServiceDatabase -Name $DatabaseName -ServiceApplication $StateServiceApp
#Create Proxy for State Service
New-SPStateServiceApplicationProxy -Name $ServiceAppProxyName -ServiceApplication $StateServiceApp -DefaultProxyGroup
Initialize-SPStateServiceDatabase -Identity $Database
Write-host "State Service Application Created Successfully!"