In this tutorial, you learn the fundamentals of Windows Azure SQL Data Sync using the Windows Azure (Preview) portal.
This tutorial assumes minimal prior experience with SQL Server and Windows Azure SQL Database. In this tutorial, you create a hybrid (SQL Server and SQL Database instances) sync group fully configured and synchronizing on the schedule you set.
Sign in to the Management Portal.
Click SQL DATABASES in the left pane.
Click SYNC at the bottom of the page. When you click SYNC, a list appears showing the things you can add – New Sync Group and New Sync Agent.
To launch the New SQL Data Sync Agent wizard, click New Sync Agent.
If you haven't added an agent before, click download it here.
This step is required only if you are going to have an on-premises SQL Server database included in your sync group. You can skip to Step 4: Create a sync group if your sync group has only SQL Database instances.
Be sure that you have the following installed on the computer you install the Client Agent.
.NET Framework 4.0
You can install .NET Framework 4.0 from here.
Microsoft SQL Server 2008 R2 SP1 System CLR Types (x86)
You can install the Microsoft SQL Server 2008 R2 SP1 System CLR Types (x86) from here
Microsoft SQL Server 2008 R2 SP1 Shared Management Objects (x86)
You can install the Microsoft SQL Server 2008 R2 SP1 Shared Management Objects (x86) from here
Follow the instruction at Install a Client Agent (SQL Data Sync) to install the agent.
After the Client Agent is installed, register every on-premises SQL Server database that you intend to include in a sync group with the agent. To register a database with the agent, follow the instructions at Register a SQL Server Database with a Client Agent.
From the dropdown, select the CONFLICT RESOLUTION policy.
Hub Wins – any change written to the hub database is written to the reference databases, overwriting changes in the same reference database record. Functionally, this means that the first change written to the hub is propagated to the other databases.
Client Wins – changes written to the hub are overwritten by changes in reference databases. Functionally, this means that the last change written to the hub is the one kept and propagated to the other databases.
Click the right-arrow.
Repeat this step for each additional database you want to add to the sync group.
From the dropdown, select the database to add.
Databases in the dropdown include both SQL Server databases that have been registered with the agent and SQL Database instances.
From the dropdown, select the SYNC DIRECTION for this database.
Bi-directional – changes in the reference database are written to the hub database, and changes to the hub database are written to the reference database.
Sync from the Hub - The database receives updates from the Hub. It does not send changes to the Hub.
Sync to the Hub - The database sends updates to the Hub. Changes in the Hub are not written to this database.
To finish creating the sync group, click the check mark in the lower right of the wizard. Wait for the SQL Data Sync to confirm the credentials. A green check indicates that the credentials are confirmed.
Click the check mark a second time. This returns you to the SYNC page under SQL Databases. This sync group is now listed with your other sync groups and agents.
Windows Azure SQL Data Sync allows you to select tables and columns to synchronize. If you also want to filter a column so that only rows with specific values (such as, Age>=65) are synchronized, use the SQL Data Sync portal at Windows Azure and the documentation at Select the Tables, Columns, and Rows to Synchronize to define the data to sync.
You can always synchronize a sync group by clicking SYNC at the bottom of the Data Sync landing page. If you want a sync group to synchronize on a schedule, you configure the sync group.
Congratulations. You have created a sync group that includes both a SQL Database instance and a SQL Server database.
For additional information on SQL Database and SQL Data Sync see: