I have created a Provider Hosted App for SharePoint On-Premises and SharePoint Online.

My requirement is that this app should only installed if its a Site Collection. If it is a Site within a Site Collection then in that case this app should not installed.

So How Can I protect a Provider Hosted App from being install in sub site?

Proposed Approach

I have gone through this and this. Now What I am thinking, Can I capture an app installed event, and once the app is installed, I will check whether the Host web is Site Collection or Sub Site, and If its Sub Site then I will rollback the installation.

So again my question arise, can I uninstall the installed Add-In in AppInstalled event?

Your Answer

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

Browse other questions tagged or ask your own question.