You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d0d8dab
Browse filesBrowse the repository at this point in the historyBrowse files
In this tutorial, you learn how to set up SQL Data Sync by creating a sync group that contains both Azure SQL Database and SQL Server instances. The sync group is custom configured and synchronizes on the schedule you set.
@@ -28,60 +29,60 @@ For PowerShell examples on how to configure SQL Data Sync, see [How to sync betw
28
29
29
30
1. Go to the [Azure portal](https://portal.azure.com) to find your database in SQL Database. Search for and select **SQL databases**.
30
31
31
-

32
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/search-for-sql-databases.png" alt-text="A screenshot of the Azure portal search for databases.":::
32
33
33
34
1. Select the database you want to use as the hub database for Data Sync.
34
35
35
-
:::image type="content" source="./media/sql-data-sync-sql-server-configure/select-sql-database.png" alt-text = "Select from the database list, Microsoft Azure portal":::
36
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/select-sql-database.png" alt-text = "A screenshot from the Azure portal showing where to select from the database list.":::
36
37
37
38
> [!NOTE]
38
39
> The hub database is a sync topology's central endpoint, in which a sync group has multiple database endpoints. All other member databases with endpoints in the sync group, sync with the hub database.
39
40
40
41
1. On the **SQL database** menu for the selected database, select **Sync to other databases**.
41
42
42
-
:::image type="content" source="./media/sql-data-sync-sql-server-configure/sync-to-other-databases.png" alt-text = "Sync to other databases, Microsoft Azure portal":::
43
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/sync-to-other-databases.png" alt-text = "A screenshot from the Azure portal page for an Azure SQL database, showing the Sync to other databases menu option.":::
43
44
44
45
1. On the **Sync to other databases** page, select **New Sync Group**. The **New sync group** page opens with **Create sync group**.
45
46
46
-
:::image type="content" source="./media/sql-data-sync-sql-server-configure/create-sync-group.png" alt-text = "Set up new sync group with private link":::
47
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/create-sync-group.png" alt-text = "A screenshot from the Create Data Sync page of the Azure portal.":::
47
48
48
49
On the **Create Data Sync Group** page, change the following settings:
|**Sync Group Name**| Enter a name for the new sync group. This name is distinct from the name of the database itself. |
53
-
|**Sync Metadata Database**| Choose to create a database (recommended) or to use an existing database.<br/><br/>If you choose **New database**, select **Create new database.** Then on the **SQL Database** page, name and configure the new database and select **OK**.<br/><br/>If you choose **Use existing database**, select the database from the list. |
54
-
|**Automatic Sync**| Select **On** or **Off**.<br/><br/>If you choose **On**, enter a number and select **Seconds**, **Minutes**, **Hours**, or **Days** in the **Sync Frequency** section.<br/> The first sync begins after the selected interval period elapses from the time the configuration is saved.|
55
-
|**Conflict Resolution**| Select **Hub win** or **Member win**.<br/><br/>**Hub win** means when conflicts occur, data in the hub database overwrites conflicting data in the member database.<br/><br/>**Member win** means when conflicts occur, data in the member database overwrites conflicting data in the hub database. |
54
+
|**Sync Metadata Database**| Choose to create a database (recommended) or to use an existing database.<br/><br/>If you choose **New database**, select **Create new database.** Then on the **SQL Database** page, name and configure the new database and select **OK**.<br/><br/>If you choose **Use existing database**, select the database from the list. |
55
+
|**Automatic Sync**| Select **On** or **Off**.<br/><br/>If you choose **On**, enter a number and select **Seconds**, **Minutes**, **Hours**, or **Days** in the **Sync Frequency** section.<br />The first sync begins after the selected interval period elapses from the time the configuration is saved.|
56
+
|**Conflict Resolution**| Select **Hub win** or **Member win**.<br/><br/>**Hub win** means when conflicts occur, data in the hub database overwrites conflicting data in the member database.<br/><br/>**Member win** means when conflicts occur, data in the member database overwrites conflicting data in the hub database. |
56
57
|**Use private link**| Choose a service managed private endpoint to establish a secure connection between the sync service and the hub database. |
57
58
58
59
> [!NOTE]
59
60
> Microsoft recommends to create a new, empty database for use as the **Sync Metadata Database**. Data Sync creates tables in this database and runs a frequent workload. This database is shared as the **Sync Metadata Database** for all sync groups in a selected region and subscription. You can't change the database or its name without removing all sync groups and sync agents in the region. Additionally, an Elastic jobs database cannot be used as the SQL Data Sync Metadata database and vice versa.
60
61
61
62
Select **OK** and wait for the sync group to be created and deployed.
62
-
63
+
63
64
1. On the **New Sync Group** page, if you selected **Use private link**, you will need to approve the private endpoint connection. The link in the info message will take you to the private endpoint connections experience where you can approve the connection.
:::image type="content" source="./media/sql-data-sync-sql-server-configure/approve-private-link-update.png" alt-text = "A screenshot from the Azure portal Private Endpoint connections page, showing where to approve a private link.":::
67
+
67
68
> [!NOTE]
68
69
> The private links for the sync group and the sync members need to be created, approved, and disabled separately.
69
70
70
71
## Add sync members
71
72
72
73
After the new sync group is created and deployed, open the sync group and access the **Databases** page, where you will select sync members.
:::image type="content" source="./media/sql-data-sync-sql-server-configure/add-sync-members.png" alt-text = "A screenshot from the Azure portal showing the Select sync members page.":::
76
+
76
77
> [!NOTE]
77
78
> To update or insert the username and password to your hub database, go to the **Hub Database** section in the **Select sync members** page.
78
79
79
-
### To add a database in Azure SQL Database
80
+
### Add a database in Azure SQL Database
80
81
81
82
In the **Select sync members** section, optionally add a database in Azure SQL Database to the sync group by selecting **Add an Azure Database**. The **Configure Azure Database** page opens.
82
-
83
-
:::image type="content" source="./media/sql-data-sync-sql-server-configure/step-two-configure.png" alt-text = "Add a database to the sync group":::
84
-
83
+
84
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/step-two-configure.png" alt-text = "A screenshot from the Azure portal of the Configure Azure Database page, where you can add a database to the sync group.":::
85
+
85
86
On the **Configure Azure SQL Database** page, change the following settings:
86
87
87
88
| Setting | Description |
@@ -98,13 +99,13 @@ In the **Select sync members** section, optionally add a database in Azure SQL D
98
99
99
100
<aname="add-on-prem"></a>
100
101
101
-
### To add a SQL Server database
102
+
### Add a SQL Server database
102
103
103
104
In the **Member Database** section, optionally add a SQL Server database to the sync group by selecting **Add an On-Premises Database**. The **Configure On-Premises** page opens where you can do the following things:
104
105
105
106
1. Select **Choose the Sync Agent Gateway**. The **Select Sync Agent** page opens.
106
107
107
-
:::image type="content" source="./media/sql-data-sync-sql-server-configure/steptwo-agent.png" alt-text = "Creating a sync agent":::
108
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/steptwo-agent.png" alt-text = "A screenshot from the Azure portal, in the Configure On-Premises steps. When the Choose the Sync Agent Gateway option is selected, the Select Sync Agent page is shown.":::
108
109
109
110
1. On the **Choose the Sync Agent** page, choose whether to use an existing agent or create an agent.
110
111
@@ -125,32 +126,32 @@ In the **Member Database** section, optionally add a SQL Server database to the
125
126
126
127
1. On the SQL Server computer, locate and run the Client Sync Agent app.
127
128
128
-

129
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/datasync-preview-clientagent.png" alt-text="A screenshot from the Microsoft SQL Data Sync 2.0 client agent app. The Submit Agent Key button is highlighted.":::
129
130
130
131
1. In the sync agent app, select **Submit Agent Key**. The **Sync Metadata Database Configuration** dialog box opens.
131
132
132
133
1. In the **Sync Metadata Database Configuration** dialog box, paste in the agent key copied from the Azure portal. Also provide the existing credentials for the server on which the metadata database is located. (If you created a metadata database, this database is on the same server as the hub database.) Select **OK** and wait for the configuration to finish.
133
134
134
-

135
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/datasync-preview-agent-enterkey.png" alt-text="Enter the agent key and server credentials.":::
135
136
136
137
> [!NOTE]
137
-
> If you get a firewall error, create a firewall rule on Azure to allow incoming traffic from the SQL Server computer. You can create the rule manually in the portal or in SQL Server Management Studio (SSMS). In SSMS, connect to the hub database on Azure by entering its name as <hub_database_name>.database.windows.net.
138
+
> If you get a firewall error, create a firewall rule on Azure to allow incoming traffic from the SQL Server computer. You can create the rule manually in the portal or in SQL Server Management Studio (SSMS). In SSMS, connect to the hub database on Azure by entering its name as `<hub_database_name>.database.windows.net`.
138
139
139
140
1. Select **Register** to register a SQL Server database with the agent. The **SQL Server Configuration** dialog box opens.
140
141
141
-

142
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/datasync-preview-agent-adddb.png" alt-text="Add and configure a SQL Server database.":::
142
143
143
144
1. In the **SQL Server Configuration** dialog box, choose to connect using SQL Server authentication or Windows authentication. If you choose SQL Server authentication, enter the existing credentials. Provide the SQL Server name and the name of the database that you want to sync and select **Test connection** to test your settings. Then select **Save** and the registered database appears in the list.
144
145
145
-

146
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/datasync-preview-agent-dbadded.png" alt-text="A screenshot from the Microsoft SQL Data Sync 2.0 application showing that the SQL Server database and machine are now registered.":::
146
147
147
148
1. Close the Client Sync Agent app.
148
149
149
-
1. In the portal, on the **Configure On-Premises** page, select **Select the Database**.
150
+
1. In the Azure portal, on the **Configure On-Premises** page, select **Select the Database**.
150
151
151
152
1. On the **Select Database** page, in the **Sync Member Name** field, provide a name for the new sync member. This name is distinct from the name of the database itself. Select the database from the list. In the **Sync Directions** field, select **Bi-directional Sync**, **To the Hub**, or **From the Hub**.
152
153
153
-

154
+
:::image type="content" source="./media/sql-data-sync-sql-server-configure/datasync-preview-selectdb.png" alt-text="A screenshot from the Azure portal, showing the Select Database page. Under Sync Directions, Bi-directional Sync is highlighted.":::
154
155
155
156
1. Select **OK** to close the **Select Database** page. Then select **OK** to close the **Configure On-Premises** page and wait for the new sync member to be created and deployed. Finally, select **OK** to close the **Select sync members** page.
156
157
@@ -161,7 +162,7 @@ In the **Member Database** section, optionally add a SQL Server database to the
161
162
162
163
After the new sync group members are created and deployed, go to the **Tables** section in the **Database Sync Group** page.
:::image type="content" source="./media/sql-data-sync-sql-server-configure/configure-sync-group.png" alt-text="In the Azure portal, un the Tables page, select tables and fields to sync.":::
165
166
166
167
1. On the **Tables** page, select a database from the list of sync group members and select **Refresh schema**. Please expect a few minutes delay in refresh schema, the delay might be a few minutes longer if using private link.
167
168
@@ -171,7 +172,7 @@ After the new sync group members are created and deployed, go to the **Tables**
171
172
172
173
1. By default, databases are not synced until scheduled or manually run. To run a manual sync, navigate to your database in SQL Database in the Azure portal, select **Sync to other databases**, and select the sync group. The **Data Sync** page opens. Select **Sync**.
:::image type="content" source="./media/sql-data-sync-sql-server-configure/datasync-sync.png" alt-text="A screenshot from the Azure portal showing the manual sync button for a Database Sync Group.":::
175
176
176
177
## FAQ
177
178
@@ -255,4 +256,4 @@ For more info about SQL Data Sync, see:
0 commit comments