You can use graph explorer to make a HTTP request to Azure AD and also to add a member to a group.
Follow below steps to do the same,
- Got to URL https://developer.microsoft.com/en-us/graph/graph-explorer
- Click on sign-in button on the top right corner.
- Enter the global admin credentials.
- Now to add user to group you can enter below query.
- Send POST request to https://graph.microsoft.com/v1.0/groups/{group-id}/members/$ref
And in the body below enter as below,
Content-type: application/json
{
"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{id}"
}
"group-id" in the POST query is object ID of a group. and "id" is the object of the member you want to add to the group.
Below is the screen shot of above task.
Let me know if you have any further questions on this.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.