6

Other than the initial setup steps is there a difference between a Sharepoint Hosted App and a Cloud Hosted App?

Can you do anything in one and not the other?

If you create one type of app could it be easily converted to the other type and vice versa?

Any advice or guidance would be useful.

Thanks

2 Answers 2

13

Yes, there are fundamental differences between SharePoint-hosted and cloud-hosted apps.

A SharePoint-hosted app may provision basic resources into its app web such as HTML/CSS/JS files, site column/content type/list definitions, etc. Under no circumstances can server-side code run within a SharePoint-hosted app.

You can run server-side code in a cloud-hosted app, but that code must not run on the SharePoint server. Cloud-hosted apps fall into two categories:

  1. Provider-hosted
  2. Autohosted

In a provider-hosted app, you are responsible for the infrastructure (again, external to SharePoint) where your app runs. You have lots of flexibility in the sense that you can run full-blown server side code and even take advantage of frameworks like ASP.NET MVC (or even use Java, PHP, or other non-Microsoft technologies as well), but you are also responsible for things like tenant isolation.

In an autohosted app, any web or database resources your app needs will automatically be deployed to Windows Azure and SQL Azure. You can run server-side code in your Windows Azure web site and multitenancy is provided automatically.

There are hybrid approaches possible that allow you to combine SharePoint-hosted and cloud-hosted capabilities in your app, but there are some security considerations to keep in mind. More information about those, as well as the various hosting options for apps for SharePoint, can be found here. Based on these differences, one would not readily convert an app from one type to another, but one could certainly augment an existing app by taking a hybrid approach.

4
  • Does this mean you can't run server side code in feature receivers or event receivers also? (sp hosted app) Jan 31, 2013 at 11:44
  • That is correct. You can still do those sorts of things in farm and sandboxed solutions, though. Jan 31, 2013 at 12:24
  • You could technically convert ("upgrade"?) a SharePoint-hosted App to a Provider- or Auto-Hosted App by adding code to your original project. All 3 types of Apps have App Webs with the no-code restriction, and you host your code somewhere else (Azure or other server) or not at all for SP-Hosted
    – Louis
    Mar 11, 2014 at 2:41
  • Also, event and feature receivers are server-side code only (Server Object Model). If you are building Apps, look into Remote Event Receivers
    – Louis
    Mar 11, 2014 at 2:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.