Hi,
I am using Business Central Automation apis to update user's userGroup membership. For Automatuon API I am using Azure AD application with OAuth grant type of client_credentials. I am able to update user's Permission Sets with the same access token but when I try to update user's userGroup membership, I got following error, which indicates that Azure AD app don't have permission on the table.

REST request
POST https://api.businesscentral.dynamics.com/v2.0/xyz.onmicrosoft.com/production/api/microsoft/automation/v2.0/users(71cf1a08-abd2-4e11-a21b-031c62b5d574)/userGroupMembers?company=CRONUS USA, Inc.
Request Body
{
"code": "D365 EXT. ACCOUNTANT",
"companyName" :"CRONUS USA, Inc."
}F
I even have tried to give SUPER permissions set to the Azure AD application but that didn't help.
On Azure AD, Application has following permission under application permissions, with admin consent given both on Azure and business Central. No delegated permissions given because I want to run this application context only.

What else permissions required? On the other hand if I use Basic authentication in the context of the Global administrator then the same request works, obviously global admin has access to all tables while Azure AD app have limited access to tables, but there is no built in permission Sets or userGroups which can allow azure AD application to perform the above task.