HOW TO: Deploy a provider hosted app as an Azure site


This post is a contribution from Charls Tom Jacob, an engineer with the SharePoint Developer Support team.

In this blog, I will describe the steps to deploy a provider hosted app on Windows Azure hosted site (same steps should work for any IIS sites for that matter).  The app will be deployed into SharePoint Online site, whereas the underlying business logic will reside on a separate server.  It could be an on-premise server or a server provided by a hosting company.  For this blog post, I decided to use a site hosted on Azure.

1. Create a provider hosted app project in Visual Studio 2012.

clip_image002

2. Select ACS.

clip_image004

3. Navigate to your App Catalog site collection URL (/_layouts/15/appregnew.aspx).

a. Generate a Client ID and Client Secret.

b. Make sure to give correct values for AppDomain and Redirect URL. This should be corresponding to where you want to host your app web.

clip_image006

4. Publish the App project by specifying the same Redirect URL, Client ID and Client Secret as in the previous step.

clip_image008

5. This gives you the deployable units as below.

a. Rename the .app file to .zip and verify that app manifest contains the correct Client ID.

clip_image009

6. Upload the app to the App Catalog site collection in your SharePoint site.

clip_image010

7. Modify the AppWeb web.config file to include the Client ID and Client Secret as shown below.

clip_image011

8. Deploy the web site to the desired location using any of the publishing methods available.

clip_image012

9. Add the app to one of the sites and launch it.

clip_image013

NOTE: You will run into “The parameter ‘token’ cannot be null or empty string” error if you make a mistake in the Client ID and/or Client Secret or redirect URL.

Hope this walk-through was helpful!

Comments (8)

  1. Biju Joseph says:

    Nice article, it helped me!

  2. SPDeveloper says:

    Hi, Thanks for this article. I found one more good link for Provider Hosted Apps here :
    http://hackingkart.com/how-to-create-provider-hosted-app-vol1/

  3. Vivek Jagga says:

    Hi,

    Very nice article, good written steps.
    I just want to know that how to deploy multiple (two or more) Provider Hosted apps on a single Azure web site? Is is possible or we need to create separate website on azure for each provider hosted app?

  4. Ken Paige says:

    Very helpful … well written and clear enough that even a newbie like me could follow. Thanks

  5. 364972214581243 says:

    hendjus,wo,

  6. XperT says:

    I get the following error: An error occurred while processing your request.

  7. Dr Sylvester Benson says:

    GET YOUR PROBLEM SOLVE TODAY WITH MY PROFESSION IN ANY SPIRITUAL SPELL OR ANY KIND OF PHYSICAL BATTLE THAT NEED, MY NAME IS DR SYLVESTER AND THIS IS MY EMAIL FOR CONTACT (stbenson391@gmail.com) OR YOU CAN FOLLOW HIM UP ON FACEBOOK BY MY NAME (SYLVESTER E BENSON)
    ON FACEBOOK OR CALL ME ON MY MOBILE NUMBER +2348136090988, AM ALWAYS AVAILABLE TO RENDER YOU HELP WITH EXPERIENCE OF 32 YEARS IN SPELL CASTING AND HERBAL MEDICURE TO CURE ANY KIND OF DISEASE THAT YOU MAY HAVE, CONTACT ME ON ANY KIND OF ISSUES.