Hi @Anil Kumar Akuthota ,
Thanks for reaching out.
You can enable automatic provisioning of users and groups between your application and Azure Active Directory (Azure AD) using SCIM user management API which uses two endpoints for /users and /Groups.
Below article has the SCIM examples to create user and group using Rest API endpoint
However, you can also automate Azure AD users and groups provisioning through APIs
User: You can use the Microsoft Graph API to create a user in Azure AD. Here's an example of the API call:
POST https://graph.microsoft.com/v1.0/users
Content-Type: application/json
{
"displayName": "My Group",
"mailNickname": "mygroup",
"mailEnabled": false,
"securityEnabled": true
}
- Create a Group: You can use the Microsoft Graph API to create a group in Azure AD. Here's an example of the API call:
POST https://graph.microsoft.com/v1.0/groups
Content-Type: application/json
{
"displayName": "My Group",
"mailNickname": "mygroup",
"mailEnabled": false,
"securityEnabled": true
}
3.PATCH User and Group: You can use the Microsoft Graph API to update a user or group in Azure AD. Here's an example of the API call:
PATCH https://graph.microsoft.com/v1.0/users/{user-id}
Content-Type: application/json
{
"displayName": "New Display Name"
}
PATCH https://graph.microsoft.com/v1.0/groups/{group-id}
Content-Type: application/json
{
"displayName": "New Display Name"
}
4.Add the User and Group to your App: You can use the Microsoft Graph API to add a user or group to your app in Azure AD. Here's an example of the API call:
POST https://graph.microsoft.com/v1.0/servicePrincipals/{app-id}/appRoleAssignments
Content-Type: application/json
{
"principalId": "{user-or-group-id}",
"resourceId": "{app-id}",
"appRoleId": "{app-role-id}"
Hope this will help.
Thanks,
Shweta