Is there any way to automate the SharePoint provider hosted apps installation and trusting process from appcatalog using CSOM/Rest API?

  • You have your app in your app catalog, but while adding it to the site collection its asking for trusting. And you want to avoid this situation? – Aakash Maurya Oct 26 '17 at 6:16
  • Nope @AakashMorya. I need to install my provider hosted app from appcatalog to my SharePoint online site collection using PowerShell/C# and need to avoid trusting process in that. You can't use sideloading because you can't maintain versioning using that. – Arut Oct 26 '17 at 7:05
  • 1
    This is a duplicate of (well, there are many duplicates of this topic) sharepoint.stackexchange.com/questions/198131/…. There is a method using the IE OM to do this as described in the link, but there is no programmatic way of accomplishing automatic trusting of an app. This would be a potential significant security issue if there were. – Trevor Seward Oct 26 '17 at 17:43
  • Okay Trevor. Apart from trusting, is there any way to install the apps from app catalog programmatically? Both the things which I am expecting are available in on-premises version. So I believe SharePoint does have some options to fulfill it. – Arut Oct 26 '17 at 21:12

There is no way available right now to automate apps installation and trust in SPO. But in the upcoming weeks, it will be available via ALM APIs. The timeline is not clear but I think by December end or early January 2018, we will be able to use it.

You will be able to add, install, upgrade and remove the apps. The trust process will also be handled via the ALM APIs.

The ALM APIs will have native REST API support. But if you want to use CSOM or PowerShell, it will be available via PnP Core component or PnP PowerShell.

Below is the image of the operations that you will be able to do in the near future.

enter image description here

Currently PnP team has added the support for these operations in CSOM Core and PowerShell but you will be able to use it only when these features are available in your tenant.

References -

YouTube link (starts at 16th min, you can stop at around 40th min)

ALM APIs - Preview to new APIs to automate app and SPFx solution management

PnP Powershell documentation links (self explanatory) -






Download PnP powershell - PnP-Powershell.

You need to wait for the upcoming PnP Core update to checkout these additions. Will be available in early Nov.

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.