It is now called Add-AzureADDirectoryRoleMember
.
NAME
Add-AzureADDirectoryRoleMember
SYNOPSIS
Add a member to a directory role
Example:
Add-AzureADDirectoryRoleMember -ObjectId <role id> -RefObjectId <service principal object id>
The command only expects a directory object id, no matter what its documentation says about adding a user to a role.
As noted by @rcabr, you may need to run this first:
Enable-AzureADDirectoryRole -RoleTemplateId 88d8e3e3-8f55-4a1e-953a-9b9898b8876b
You can then use the resulting object id in the next command.
The command I run:
Add-AzureADDirectoryRoleMember -ObjectId afbba7aa-c743-406a-907a-4357c6b13415 -RefObjectId 6e56b47c-4c6e-40f5-aa95-16a0b1cb44fc