Forum Discussion

Michael Schau's avatar
Michael Schau
Copper Contributor
Jul 03, 2018

Create Office 365 group for existing Team site

I'm having issues calling https://msdn.microsoft.com/en-us/library/microsoft.online.sharepoint.tenantadministration.tenant.creategroupforsite.aspx using Azure AD App Only client context. 

 

I'm receiving the following exception.

{"odata.error":{"code":"Authorization_RequestDenied","message":{"lang":"en","value":"Insufficient privileges to complete the operation."},"requestId":"c9e74c5a-c5bf-4f2f-ae4e-5d2c29b619d6","date":"2018-07-03T11:50:08"}}


 

 I've given consent to delegated permission Group.ReadWrite.All.

 What am I missing? Isn't it supported to use an App Only context. It works fine in a user context.

7 Replies

  • Anonymous's avatar
    Anonymous

    do you have the Active directory read and write permissions in the app only context? as you need them as well.

    • Michael Schau's avatar
      Michael Schau
      Copper Contributor

      I've added Application permission Read and write directory data (Directory.ReadWrite.All), but it doesn't make a difference.

       

      Group.ReadWrite.All is added as Delegated permission as it doesn't exist as Application permission. Does this mean that it isn't possible to use an AppOnly context (no user context).

       

       

       

      • Anonymous's avatar
        Anonymous

        Please take a look at the site of John as he managed to do this http://johnliu.net/blog/2017/1/create-many-o365-groups-with-powershell-resource-owner-granttype-and-microsoft-graph

         

Resources