I understand there is azure portal to manage groups, user and etc.
Are there any ways to do it programmatically (either using web-api or sdk in C#)?
Thanks in advance.
It is easy to create Azure AD users using the Microsoft Graph REST. Here is a code sample for your reference:
POST https://graph.microsoft.com/v1.0/users
Authorization: Bearer {token}
Content-type: application/json
{
"accountEnabled": true,
"displayName": "displayName-value",
"mailNickname": "mailNickname-value",
"userPrincipalName": "[email protected]",
"passwordProfile" : {
"forceChangePasswordNextSignIn": true,
"password": "password-value"
}
}
It also provides the corresponding library using C# from here. More detail about Microsoft Graph, you can refer the link below:
Overview of Microsoft Graph
Get access tokens to call Microsoft Graph
Create User
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With