Assign Azure AD role to service principal for rbac possible ?

Tommy Kozlowski 46 Reputation points
2022-04-12T15:32:39.237+00:00

Hi,

We want to automate group membership from Azure AD groups.
The "Groups Administrator" role seems appropriate but this is an Azure AD role, not an Azure role so we cannot assign it to a service principal.

What are our options, we don't want to interactive login for running these scripts
thanks

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,601 questions
0 comments No comments
{count} votes

Accepted answer
  1. Shweta Mathur 27,786 Reputation points Microsoft Employee
    2022-04-13T07:34:55.627+00:00

    Hi @Tommy Kozlowski

    Thanks for reaching out.

    I understand that you are looking to assign "Group Administrator" Azure AD role to the service principal to manage Azure AD groups.

    You can directly assign the Azure AD role to service principal as well. By default, Azure Ad applications will not display in the available options, you have to type and select it.

    To assign Azure AD role to service principal, Go to Azure AD -> Roles and administrators -> Select the role you want to assign to Service principal.

    192612-image.png

    Go to Assignment ->Add Assignments-> Select the application to which you want to assign the Azure AD role.

    192583-image1.png

    Service principal has been successfully assigned to Azure AD role as shown here:

    192622-image.png

    Here applications are allowed for "Active assignment" only.

    Hope this will help.

    Thanks,
    Shweta

    ------------------------------------------------

    Please remember to "Accept Answer" if answer helped you.

    7 people found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Tommy Kozlowski 46 Reputation points
    2022-04-13T08:27:52.827+00:00

    thanks a lot !

    0 comments No comments

  2. Suryendu Bhattacharyya 0 Reputation points
    2023-08-23T15:14:09.4+00:00

    Hi @Tommy Kozlowski once you sign in using Connect-MgGRaph can you perform the operations using the service principal ?

    0 comments No comments