Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 10 down vote accepted

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.

share|improve this answer
    
Does this mean you can't run server side code in feature receivers or event receivers also? (sp hosted app) –  user1786107 Jan 31 '13 at 11:44
    
That is correct. You can still do those sorts of things in farm and sandboxed solutions, though. –  Danny Jessee Jan 31 '13 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 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 at 2:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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