When to choose SHA or PHA.
- SHA: SharePoint Hosted App
- PHA: Provider Hosted App

Apps Overview
As we all know, Apps are the preferred programming model for SharePoint 2013. Microsoft introduced the App Model in SharePoint 2013.
Apps provide the following advantages:
- Code outside Server
- Discoverability
- App Store Eco System
- Easy Installation
- Easy Un-installation
Advantages of SHA
SharePoint Hosted Apps are those in which the code is hosted in the SharePoint server. Since the App contains the JavaScript Object Model (JSOM) the execution occurs in the client side.
A pure HTML/JavaScript based application can be built using this approach.
Advantages of PHA
Provider Hosted Apps are those in which the code is hosted outside the SharePoint server. Since the App can contain both JSOM and CSOM the execution happens in another server or in the client side.
Remote Event Receivers, Custom WCF Services, Protected Business Logic can be done using this approach. ![]()
Since PHA is hosted in an external server, there requires a server-to-server trust using certificates. The trust can be Low Trust or High Trust depending on your requirements. This certificate configuration would be an additional configuration overhead going with PHA.
When to choose SHA
The following are the reasons to go with SHA:
- If you want to publish an Office App Store, then go with SHA
- If you have just HTML/JavaScript code, then go with SHA
When to choose PHA
The following are the reasons to go with PHA:
- If you have proprietary business logic, then go with PHA
- If you have custom services to be created, then go with PHA
- If you have custom event receivers, then go with PHA
- If you want to integrate an existing ASP.NET application, then go with PHA
- If you have difficulty in finding JSOM resources, then go with PHA
We are not discussing Cloud Hosted Apps (CHAs) here since it has been deprecated.
References
http://msdn.microsoft.com/library/office/dn268593.aspx
Summary
This article explored SHA vs. PHA.


Sumit KumarPosted Jul 8, 2020, 9:21 PM EDT
Thanks for the sharing article abt SHA and PHA. please publish on blog PHA for SharePoint 2019. Thanks
Amit KumarPosted Feb 19, 2015, 12:08 AM EST
Sir, I want to know the scenario where REST API/ OData should be preferred than CSOM. Pls give an example and also share the link for using REST....
Jean PaulTOP 100Posted Feb 16, 2015, 5:04 AM EST
Dear Amit, Apps are used to remove server-side coding OR to publish solution to a broader market space like App Store OR for O365 custom solutions. Also, Nowadays more & more clients are preferring App Model
Jean PaulTOP 100Posted Jan 20, 2015, 3:33 PM EST
Thank You Tarun & Archana. I hope I know you all.. :)
archana singhPosted Jan 20, 2015, 3:31 PM EST
Nice one Jean!!!
Tarun DPosted Jan 19, 2015, 8:14 PM EST
Thanks for sharing
Jean PaulTOP 100Posted Jan 16, 2015, 9:10 AM EST
You are Welcome Amit! Happy SharePointing.. :)
Amit KumarPosted Jan 16, 2015, 7:49 AM EST
Very new terms for SharePointers......Thanx
Jean PaulTOP 100Posted Jan 12, 2015, 7:23 AM EST
Thank You Vithal!
Vithal WadjeTOP 100Posted Jan 11, 2015, 9:01 PM EST
thanks for sharing ,nice explanation