Errors Configuring Azure SQL DataSync 2.0 agent
Published Mar 13 2019 06:44 PM 3,300 Views
Copper Contributor
First published on MSDN on Jul 10, 2017
When adding an on-premise member database to a datasync 2.0 sync group, you will need to configure the local sync agent following these steps:

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-get-started-sql-data-sync

Sometimes, the you may run into errors.

Error Type 1:

“Submitted agent key is invalid. The agent key could not be parsed as expected. Please resubmit a valid agent key”

“Please enter a valid agent key to proceed. The key must be generated from SQL Data Sync web portal”

"System.Data.SqlClient.SqlException,Message=Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. This failure occurred while attempting to connect to the routing destination”

These errors are caused by insufficient user permissions. To be able to successfully configure the local sync agent you will need these permissions:

  1. Azure SQL server CONTRIBUTOR

  2. A member of DataSync_Executor role in sync metadata database

  3. On hub/member databases:


Error Type 2:

“Agent must be upgraded. Please download and install the latest agent”

To resolve this issue:

  1. Check the file version of the data sync agent client, DataSyncLocalAgentHost.exe. The file version should be 4.3.xxxx. The default path is:
    C:\Program Files (x86)\Microsoft SQL Data Sync 2.0\bin\DataSyncLocalAgentHost.exe

  2. If the file version is correct, check the dss.agent_version table in the sync metadata database using:

    [code language="sql"]SELECT * FROM dss.agent_version WHERE comment = 'current'[/code]

    The correct version should be 4.2.0.0.

    If the table is empty, you need to insert a row to the table:

    [code language="sql"]INSERT INTO dss.agent_version(Id,Version,ExpiresOn,Comment) VALUES(1,'4.2.0.0','Dec 31 9999 11:59PM','current')[/code]

    If the version is incorrect, you need to update the table:

    [code language="sql"]UPDATE dss.agent_version SET version = '4.2.0.0' WHERE comment = 'current'[/code]


Version history
Last update:
‎Mar 13 2019 06:44 PM
Updated by: