0

I'm finally done with my long running SP2010 project and am only just now getting into SP2013. And I'm having some trouble understanding the concept of provider hosted apps.

I've read the MSDN article on choosing patterns for developing apps. SharePoint hosted apps apparently can only use SP components and Javascript & HTML. Seems pretty clear, I get that. But then it says provider hosted apps have "remote components [that] are hosted on another server." And you can use "any language", which presumably includes server-side code. So... are provider hosted apps supposed to interact with another, non-SP system?

Then, there's this MSDN tutorial for how to create a basic provider hosted app. In it you create an aspx page that has C# code-behind, which interacts with SP using the CSOM. But it's deployed to the SP server. Where are the remote components? Why is it allowed to run server-side code on the SP server? Admittedly, it's not running SP server object model code, but still, at this point I'm confused.

So, what is a provider hosted app? It can apparently run server-side C# ASP on a SharePoint server...can it run SP server object model code? In the first article I linked to, in the provider hosted section, it says "bring your own server hosting infrastructure." Does that mean you can only deploy provider hosted apps to an on-premises SharePoint farm? Or can you deploy a provider hosted app to the cloud?

Can anyone explain this clearly to me?

0

The "external bits" are external to SharePoint. They may - and can live on the same server as SharePoint (though never recommended for production). The external bits can be a .NET web app, PHP, or whatever. Most of the samples online are for .NET, and that is the fasted route as you get access to things like tokenhelp.cs which help manage the token requests/management with SharePoint. If you use something other than .NET you have manually manage that stuff.

The "App" model is supported both on-prem and in O365. Most of the app deployment models are supported in both with the exception of High Trust apps which can only be deployed on-prem.

MSDN had TONS more info on app model out there. Review the following for some more high level stuff: http://msdn.microsoft.com/en-us/library/office/fp179930%28v=office.15%29.aspx

0

I will give this a try...

A SP-hosted app is a JS script that runs in the SP page, using JSOM.

A SP provider-hosted app is a C# app or JS app which runs in a web-server (separate from SP) and accesses SP using CSOM or JSOM. Since it runs in a web-server, if it is IIS, it would be ASP.NET and it can be either WebForms or MVC.

They say and presumably it could run under Ruby/LAMP.

It must talk OAuth and it runs in a site called an AppWeb. This site is invisible (usually) to users and it accesses user data in the user site called the HostWeb.

Most of the working samples I have seen publish the app to Azure, but I think it can also be on-prem (even though SPO is in the cloud).

I have found the Lab.md stored here to be the most useful for this:

https://github.com/OfficeDev/TrainingContent/tree/master/O3652/O3652-5%20Deep%20Dive%20into%20SharePoint%20Hosted%20Apps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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