首页 > 代码库 > How to develop a provider hosted App that is hosted in Azure websites and linked to SharePoint Online?

How to develop a provider hosted App that is hosted in Azure websites and linked to SharePoint Online?

Prerequisites

  1. SharePoint Office 365 site: You can select the developer template to create your site collection. If you haven’t O365 account, you can go to the web site and apply a free account.

     

    If you need select the publishing portal template, you need enable Side Loading feature to support App install through SharePoint Online Management Shell Tools. Here, you can get the powershell named EnableSideLoading.ps1.

     

    Note: If you receive the error message "cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies", run the command below, then try again. An example of this is pictured below. Set-ExecutionPolicy RemoteSigned

     

  2. Windows Azure Web Site: We use the Windows Azure Web Site to host your SharePoint provider host App.

After the Office 365 SharePoint site collection and windows azure web site have been created, let’s get into business.

  1. We open VS2013 and create a provider hosted demo:
  2. Type the Office 365 SharePoint365 site collection URL, and select Provider-Hosted radio box.
  3. Here, I select web forms application, you can choose MVC web application if you wanted.
  4. Select ACS authentication.
  5. You will find there are two projects that have been created. In fact, ProviderHostedAppDemo is SharePoint provider-hosted app, and the ProviderHostedAppDemoWeb is the web site that provider-hosted app hosted.
  6. Press F5 key to start debug, there is a hint as bellow, select Trust It.
  7. We will enter the remote web site.
  8. Where is the provider-hosted app, you can open site contents of the SharePoint Collection, you can find there is an app named ProviderHostedAppDemo, when you click this app, it will take you to the remote web site.
  9. ?Now you have known what SharePoint provider-hosted app is, now the app is hosted on my development machine not windows azure site, you will find app that is hosted in windows azure site in the following chapter. Next chapter I will take you to see how to create, read, write a list to SharePoint from remote web.