Search code examples
c#azureazure-active-directoryazure-connectazure-ad-b2b

Azure B2B gives an error for some emails


I've developed a software that automates Azure B2B invitation process. All works well. But we found that for some email addresses we receive 400 Bad Request response message when making invitation call to Azure.

Error message:

The object either is sourced from an on prem directory or is undergoing migration

Can't find any good info explains how I can fix this problem. And what is a reason of the problem.

Any thoughts?


Solution

  • I assume that you're using Azure AD Connect to sync your on-premise AD with Azure AD.

    Cause: The Email you tried to invited had been in your on-premise AD and under sync. With this suituation, you cannot invite this kind user with same Email as the on-premise user's.

    Solution:

    1. Sync this user to Azure AD and make the user to be a member in AAD.

    2. Stop sync or after sync failed, invite this user to your AAD.

    Let me know if it helps.