Wednesday 4 May 2016

Working With Provider Hosted App SharePoint Online + Azure

If you are new to provider hosted App and you would like to create a new Provider hosted app in SharePoint Online this article will help you to creating a provider hosted app in SharePoint online + windows azure as hosting infrastructure.

Provider-hosted app includes components that are deployed and hosted outside the SharePoint farm. They are installed to the host web, but their remote components are hosted on another remote server that should not be a server in the SharePoint farm.

1. Before creating Application lets first create a fresh web Application  on azure to host a Application
Log on  to https://manage.windowsazure.com click on create webApp.


Enter your WebApp Name- Click on Create WebApp Button


Once Application get created click on Application and go to dashboard tab there will be an option to download Publishing Profile click and download that publishing profile.


Now Open VS – Create New ProjectChoose Apps For SharePoint – choose hosting option as Provider Hosted –
 



Now once your application gets created lets register your app to O365/SharePoint Online Site

1. Register Your App to SharePoint Online/Office365
Open AppRegNew.aspx  - https://abc.sharepoint.com/sites/site1/_layouts/15/appregnew.aspx


 Make sure you have copied client Id and Client Secret- now go to the VS solution open AppMenifest.xml file 


Also update the web.config file-


Now go to VS Right Click on host Web=> Click on publish=> Click on Deployment – select current Profile –NEW a new Window will appear to upload your publishing Profile that you  have downloaded from Azure.


Click On finish - Again a new window will appear that will ask to provider client secret and client Id


Now click to publish your app web Project


Once your app Web publish click  right click on Host Web to Package your .app file .



Once you click on Package app your .app file will be generated  now go to Catalog site upload your .app file





Last and final step - click on Site contents - Add an App- add your app to  SharePoint Online now you are done.

Hope this article will help you a lot..

feel free to drop your comments.

Happy Coding!!