Saturday, January 23, 2016

SharePoint App and SQL Permission

When you are developing the SharePoint Add-In in Visual Studio,you might seen these errors.

Error occurred in deployment step 'Uninstall app for SharePoint': The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.

Even though you are able to view the developer site on the browser, still the Visual Studio throws the error that could confuse the developers.

Second error

Error occurred in deployment step 'Uninstall app for SharePoint': Cannot connect to the SharePoint site: Your Site Url. 
Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.

The above error, Visual studio somehow tried to manage that the server is accessible but not the site collection.
Still you are cent percent sure , the URL is correct and accessible through browser but not through Visual Studio.

Reason:
The currently logged in user account doesn't have the required permission on the SQL Server.

Resolution:
Go to your SQL server and expand the "Security" folder under the SharePoint SQL Instance.Check there you will not find the account that has facing the above issues in visual studio.
Right click on "Logins" and select the "New Login".

Now add the "Server Role" and check the "sysadmin and dbcreator".

Again try to "Deploy" the SharePoint App project , you can able go forward through the successful messages.