'Azure active directory assign roles to users within groups

I am making an application where users can join multiple azure groups. This works fine. But a user should be able to have a role only within that specific group. So a user can have different roles in different groups.

Does anyone know how I can assign roles that only exist within a group? and then get the role for a user within a specific group via the graph api?



Solution 1:[1]

To Assign the role to a user please "Add directory role member"to assign a particular role in a group.

For different types of roles that you can assign to a user please refer "Azure AD built-in roles"

Hope this helps.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mehtab Siddique