Forum Discussion
"Groups UpdateGroupAsAdmin" API throws 401 Unauthorized error
Hi Anonymous ,
Please also check in the admin portal->tenant setting that the service principal setting related to rest API using is also enable for your service principal or for the whole organization.
And also make sure all the permissions related to workspace is added for the serivice principal stands for the AAD application
Grant tenant-wide admin consent to an application - Microsoft Entra | Microsoft Learn
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you v-yangliu-msft for the answer.
Yes, of course I have enabled API usage for the service principle (otherwise I could not use API at all).
Regarding Admin consent - I believe that it is not needed while using service principles, is it? For example, if you check description of this API https://learn.microsoft.com/en-us/rest/api/power-bi/admin/groups-get-group-users-as-admin, then it is said that in case when service principle is used, there must be no admin consents granted. So I believe that this is the case also for this UpdateGroupAsAdmin.