deploying a provider hosted cloud business app

Introduction

I’ll presume here that you are familiar with creating a cloud business app. We’ll just focus on the deployment in the provider hosted mode, meaning that

  • we want to have our application accessible in SharePoint online but,
  • the application itself is hosted on our own IIS (on premise) and has a database which is installed on our own on premise Sql Server.

You’ll find important info here if you app is hosted on a site which has an SSL port different from 443.

Preparation in SharePoint

The specific SharePoint security mechanism requires that your first “register” the application in SharePoint, create a client id and client secret which you will need in visual studio in the publish wizard.

during this tutorial I’ll use my own msdn sharepoint online subscription and I’ll use my developer site.

The base address of this site is:

https://lightswitchtoolbox.sharepoint.com/sites/Developer/_layouts/15/start.aspx#/SitePages/Home.aspx

No need to try to connect to it. Obviously, replace the base address with your own SharePoint site.

We first need to go the application registration screen. Don’t try to find in SharePoint a menu entry or whatsoever. You just need to know following address:

https://lightswitchtoolbox.sharepoint.com/sites/Developer/_layouts/15/appregnew.aspx

which gives you the following screen:

image

  • Client Id: simply click the generate button
  • Client secret: again click the generate button
  • Title: for my app the title is Dummy. I guess yours will be different.
  • App Domain: I want that my app is deployed to an IIS server with following app domain: secure.opinionatedapps.com:500. It is utmost important that specify here the portnumber when your ssl connection is different than 443 !.
  • Redirect URI: https://secure.opinionatedapps.com:500/Dummy/SharepointLaunch.aspx 
    this must be a https connection and must point to the aspx page inside the root of the application called SharePointLaunch.aspx. Also specify the port number when it’s different from 443.

click on CREATE and you’ll see:

You can find more information regarding app registration here:

http://msdn.microsoft.com/en-us/library/office/jj687469(v=office.15).aspx#Retrieve

visual studio publish wizard

image

image

Important gotcha

When, for one reason or another, you regenerate the clientId and client secret and you re-publish your application, YOU MUST, remove the application from the SharePoint site, before taking the latest version from the sharepoint catalogue.