azureazure-sql-databaseazure-data-sync

Azure Sync to database


The schema is not getting updated on azure from on premise master DB. We got to refresh Schema manually from azure portal and Save. After that data is getting synced. What could be the issue?


Solution

  • Azure SQL Data Sync does not support dynamic schema changes. You have to manually replicate them. Below the official answer from Microsoft documentation.

    How do I get schema changes into a sync group?

    You have to make and propagate all schema changes manually.

    1. Replicate the schema changes manually to the hub and to all sync members.
    2. Update the sync schema.

    Adding new tables and columns. New tables and columns don't impact the current sync. Data Sync ignores the new tables and columns until you add them to the sync schema. When you add new database objects, this is the best sequence to follow:

    1. Add the new tables or columns to the hub and to all sync members.
    2. Add the new tables or columns to the sync schema.
    3. Start to insert values into the new tables and columns.

    Changing the data type of a column. When you change the data type of an existing column, Data Sync continues to work as long as the new values fit the original data type defined in the sync schema. For example, if you change the type in the source database from int to bigint, Data Sync continues to work until you insert a value that's too large for the int data type. To complete the change, replicate the schema change manually to the hub and to all sync members, and then update the sync schema.