Error: Couldn't Find Primary Key Column
Issue
The following error appears for one or more tables in a Microsoft Dynamics 365 Finance and Operations connection.
Couldn't find primary key column
Environment
Connector: Microsoft Dynamics 365 Finance and Operations
Resolution
To resolve this issue, do the following:
- In the Synapse Link wizard, disable the affected object.
- Re-enable the object to refresh the
model.jsonfile and restore the missing primary key.
If the error persists:
- Open the
model.jsonfile at the root of your storage container. - Check whether the
idcolumn appears under the affected table's definition. - If the
idcolumn is missing, contact your source system administrator to determine why it was excluded.
Cause
This issue occurs when the expected primary key column id is missing or renamed in the source table. All Microsoft Dynamics 365 Finance and Operations tables use the id column as the primary key. For more information, see Schema information.
When Azure Synapse Link exports a table without this column, Fivetran cannot initialize the sync for that table.