Thursday, 5 May 2016

Hosting a external application as a SharePoint App

There are lots of custom applications in various technologies like .NET,PHP,Mobile Applications. Hosting them in SharePoint would be beneficial for users already using SharePoint. There are many who are embracing SharePoint Online for the powerful features like Search, Storage of documents, Security. I have still not figured out how to get a Provider Hosted App which allows a custom .NET C# code to be written to handle business logic. This article is born because the attempt to deploy Provider Hosted App on NON AZURE ON LOCAL/IIS SERVER has not worked yet[Hopefully this changes...Hurry!!! This has changed.Thanks to code from msdn gallery https://code.msdn.microsoft.com/Working-provider-hosted-8fdf2d95 a provider hosted app could be successfully published to Azure]However, the workaround which was to write the custom logic using Web API and create a simple SharePoint App to point to the custom web URL.This technique can definitely help many external solutions blend with SharePoint easily.
Below are the simple steps [Thanks to a slide from slideshare]

1. Register a new app in SharePoint _layouts/15/appregnew.aspx
ClientID,ClientSecret,Title,URL,


2. Store the data in a notepad

3. Open Visual Studio. Create New Provider Hosted App.Update AppManifest with new StartUrl
and Client ID in "View Code"

4. Publish only the SharePoint App Project[Ignore the Web Portion of the project]

5. Upload the App in "Apps for Testing" section and Launch the App

No comments:

Post a Comment