We are getting the following error

Access denied. You do not have permission to perform this action or access this resource.

when executing the following code

AppPrincipalManager ap = AppPrincipalManager.GetManager(web.Context, web);

I get it with every account: my account (site collection admin), system account, ... It just doesn't work.

We need it because we want to add apps on a site by CSOM. That works, but the app permissions are not set. So we are trying to set them by the AppPrincipalManager. But then, we get an access denied error.

  • Also with app only policy it fails
    – Davy
    Jul 3, 2014 at 13:02

1 Answer 1


Our company contacted Microsoft, and this is by design. For security reasons you cannot set the permissions of an app by client side code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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