Assigning Azure Active Directory Roles for users and service principals using Python, az rest and Graph API
Blog PostsI recently got the question on how to assign Azure AD roles to Azure AD users and app registration (service principal (SPN)) using the Azure AD Graph API with the az cli & az rest command. Here’s an example Python script to assign the Global Administrator role to a user: (replace the ‘valid-user-principal-object-id’ with the objectId of the user object) A copy of the Python code can be found on… READ MORE