My requirement is to create a group in Azure AD and add a service principal as an owner of that group through Graph API - While creating the group.
Reference Doc: https://docs.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0&tabs=http
With reference to the above document, i am able to create group but the response object shown is not allowing service principal to be added as an Owner.
Body :
{ "description": "Testing 123", "displayName": "SG-test-ei",
"mailEnabled": false, "mailNickname": "SGP-test-ei", "securityEnabled": true, "[email protected]": [
"https://graph.microsoft.com/v1.0/users/qwbhty-cdd0-4c42-b857-5b8ce0ae6a9e"
],
"[email protected]": [
"https://graph.microsoft.com/v1.0/users/7f3f587a-c40a-4a63-82b1-202f35c828ee"
]
}
Seems like, https://graph.microsoft.com/v1.0/users does not recognize ObjectID for a service principal.
My question is, what [email protected] or API i should use in the body to add service principal as an Owner to the security group in Azure AD.