I have created a Service Principal for Azure DevOps and trying to add a new member to AzureAD Group via DevOps Pipeline. The group contains only users until now. Here is what have already done:
- I have establish the ARM service link connection in Azure DevOps.
- I gave Service Principal the API permision to
group.readwrite.all
inActive Directory/App registration/SP_name/Microsoft-Graph
- I have run the script in a Azure CLI Shell in Azure DevOps:
az ad group member add --group XXX-YYY-groupname --member-id 111111-111-111-111-11111
The DevOps pipeline fails with message:ERROR: Insufficient privileges to complete the operation.
What am I missing in delegating DevOps Service Principal to add members to my group?