Hello @Gola, Mariusz,
Thank you for posting your query on Microsoft Q&A.
I understand that when you are trying to create a new user in a Azure AD B2C tenant, it is throwing this error Microsoft.Online.DirectoryServices.DirectoryUniquenessException.
Please note that this issue is related to the uniqueness of the user's identity in Microsoft Entra ID(Azure AD). Even though you have verified that you do not have a user account with the same email address or UPN(User Principal Name) that was about to be created, but it is possible that there is a conflict with an existing user's immutable ID.
The immutable ID is a unique identifier for each user in Azure AD B2C tenant that is used to map the user between Azure AD B2C and the application. It is possible that the user's immutable ID is still associated with their old account in your Azure AD B2C tenant, even though the user account has been deleted or deactivated. This can happen if the user's old account was not properly removed from your Azure AD B2C tenant.
To resolve this issue, you can try the following steps:
- Check if the user's old account is still present in your Azure AD B2C tenant. If it is present, delete or deactivate that account.
- Check if the user's immutable ID is still associated with their old account. If it is still associated, please remove the immutable ID from the old account.
- Please try registering again with the user's new email address and check the behavior.
I hope this above information provided is helpful. Please feel free to reach out if you have any further questions.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".