Press "Enter" to skip to content

Publishing a SharePoint provider hosted App (part 1)

Steps to publishing a provider-hosted SharePoint app to the Office Store

I recently had to go through the task of publishing our first app (OneBit Survey Master) to the Office Store. While the process is documented in parts throughout various msdn help files, I hope the step by step process outlined below might be useful for some of you.

Step 1 –  Obtaining a client id

Head over to and login to your account.

Click the client ids link and then add a new oauth client id. Fill in the requested details making sure the app domain and app redirect url are filled in correctly. If your SSL certificate for your domain includes the www portion – fill it in, otherwise do not since if the domains don’t match, Office365 will refuse to give you a valid context later on.

On the next page you will be presented with your client id and secret (I’ve generated sample ones just do show you). Make sure you write these down somewhere as you won’t be able to find the client secret once you hit the done button.

Step 2 – Put the client id and secret in the Visual Studio project

Open up your web application’s web.config file and add the following two lines inside the App settings node.

<add key=”ClientSecret” value=”UQ9OhENMFSeqQQQrhfAqBBBi1/9ONCrCFYYYUF1XTKc=” />

<add key=”ClientId” value=”89a9a96a-b7f1-4ff8-a771-a00a120de5dc” />

The token helper included in the latest SharePoint projects will use these values when trying to authenticate with the Office365 servers to retrieve user data. Make sure you trim spaces as sometimes they get copied over creating all sorts of headaches.

Now open up the AppManifest.xml on the SharePoint project by right clicking it and selecting view code.

You should use the same ClientId for the Remote Web Application Id. Your AppPrincipal node should look like this.


<RemoteWebApplication ClientId=”89a9a96a-b7f1-4ff8-a771-a00a120de5dc” />


Set an appropriate start page where you will handle the SharePoint context under the Properties node:


Step 3 – Test out the app by uploading it to a developer site

The best way to test out your application is to publish it to an Office 365 Developer Site and test it out online. MSDN has a great step by step guide on getting your own developer site for free:

Once you are logged into your developer site, click the new app to deploy link and select the app package file which is generated from your SharePoint project.

To create the app package, you will need to publish the SharePoint project by right clicking on it and selecting publish. Make sure that your publish options look like this

Step 4 &ndash; Test out your app

Once your app package file is uploaded, your application will appear under the Apps in testing pane of the developer account. Click the link and if you have configured everything correctly, you should be redirected to your application.

Our first App, OneBit Survey Master is a neat little tool that provides survey functionality for all kinds of use cases. It has quite a lot of features that the standard out-of-the-box SharePoint surveys don’t provide. You can find more information on our website’s product details page and you can check out OneBit Survey Master for free at the Microsoft Marketplace.


Stefan Ratchev is a Senior Developer at OneBit Software who leads the development of web-based solutions with the .NET framework. Follow more activities on this blog through RSS.