Office 365 synchronization fails with:
ERROR: insert or update on table "Users" violates foreign key constraint "Users_CountryID" DETAIL: Key (CountryID)=(un) is not present in table "Country".
The cause is a software-related issue #APSA-18910.
Please contact your Technical Account Manager or Pooled Team Associate(email@example.com) to schedule Office 365 upgrade to version 17.1.2
In order to workaround the issue, please do the following steps:
- Go to the Microsoft Online Portal > Admin Center > Users
- Choose the affected user
- Next to Display name and Office phone click Edit
- Scroll to the end of the page and set up an empty country code
- Re-run the synchronization.