Hello anonymous user, you can create them using the MS Graph API and setting the user identities property. The UPN will be auto-generated by Azure AD B2C.
Use batching to send many requests instead of just one to reduce resource consumption and throttling issues. Also, take a look to Microsoft Graph throttling guidance.
Eg.
Email authentication:
{
"identities": [
{
"signInType": "emailAddress",
"issuer": "myb2ctenant.onmicrosoft.com",
"issuerAssignedId": "myemailaddress@gmail.com"
}
],
"passwordProfile": {
"password": "<PLAIN TEXT PASSWORD>",
"forceChangePasswordNextSignIn": false
},
"passwordPolicies": "DisablePasswordExpiration"
}
Phone authentication:
{
"identities": [
{
"signInType": "phoneNumber",
"issuer": "myb2ctenant.onmicrosoft.com",
"issuerAssignedId": "<PHONE NUMBER INCLUDING COUNTRY CODE>"
}
],
"passwordProfile": {
"password": "<PLAIN TEXT PASSWORD>",
"forceChangePasswordNextSignIn": false
},
"passwordPolicies": "DisablePasswordExpiration"
}
Let us know if this answer was helpful to you. If so, please remember to accept it so that others in the community with similar questions can more easily find a solution.