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
Copy file name to clipboardExpand all lines: azure-sql/database/scripts/sql-data-sync-sync-data-between-sql-databases-rest-api.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ This REST API example configures SQL Data Sync to sync data between multiple dat
25
25
For an overview of SQL Data Sync, see [Sync data across multiple cloud and on-premises databases with SQL Data Sync in Azure](../sql-data-sync-data-sql-server-sql-database.md).
26
26
27
27
> [!IMPORTANT]
28
-
> SQL Data Sync does not support Azure SQL Managed Instance at this time.
28
+
> SQL Data Sync does not support Azure SQL Managed Instance or Azure Synapse Analytics at this time.
Copy file name to clipboardExpand all lines: azure-sql/database/sql-data-sync-agent-overview.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ ms.date: 12/20/2018
19
19
Sync data with SQL Server databases by installing and configuring the Data Sync Agent for SQL Data Sync in Azure. For more info about SQL Data Sync, see [Sync data across multiple cloud and on-premises databases with SQL Data Sync](sql-data-sync-data-sql-server-sql-database.md).
20
20
21
21
> [!IMPORTANT]
22
-
> SQL Data Sync does **not** support Azure SQL Managed Instance at this time.
22
+
> SQL Data Sync does **not** support Azure SQL Managed Instance or Azure Synapse Analytics at this time.
23
23
24
24
## Download and install
25
25
@@ -70,7 +70,7 @@ To immediately invalidate or retire an agent, regenerate its key in the portal b
70
70
If you want to run the local agent from a different computer than it is currently on, do the following things:
71
71
72
72
1. Install the agent on desired computer.
73
-
2.Log in to the SQL Data Sync portal and regenerate an agent key for the new agent.
73
+
2.Sign in to the SQL Data Sync portal and regenerate an agent key for the new agent.
74
74
3. Use the new agent's UI to submit the new agent key.
75
75
4. Wait while the client agent downloads the list of on-premises databases that were registered earlier.
76
76
5. Provide database credentials for all databases that display as unreachable. These databases must be reachable from the new computer on which the agent is installed.
@@ -81,7 +81,7 @@ In order to delete a Sync metadata database that has a Sync agent associated wit
81
81
82
82
1. Select the Sync database.
83
83
2. Go to the **Sync to other databases** page.
84
-
3. Select the Sync agent and click on **Delete**.
84
+
3. Select the Sync agent and select on **Delete**.
85
85
86
86
## <aname="agent-tshoot"></a> Troubleshoot Data Sync Agent issues
87
87
@@ -161,7 +161,7 @@ You discover that the agent isn't running on a computer that hosts SQL Server. W
161
161
1. In the **Password** box, enter your password.
162
162
1. In the **Confirm Password** box, reenter your password.
163
163
1. Select **Apply**, and then select **OK**.
164
-
1. In the **Services** window, right-click the **SQL Data Sync Agent** service, and then click**Start**.
164
+
1. In the **Services** window, right-click the **SQL Data Sync Agent** service, and then select**Start**.
165
165
1. Close the **Services** window.
166
166
167
167
### <aname="agent-key"></a> I can't submit the agent key
@@ -330,7 +330,7 @@ For more info about SQL Data Sync, see the following articles:
330
330
-[Use PowerShell to sync between a database in Azure SQL Database and a database in a SQL Server instance](scripts/sql-data-sync-sync-data-between-azure-onprem.md)
331
331
- Best practices - [Best practices for Azure SQL Data Sync](sql-data-sync-best-practices.md)
332
332
- Monitor - [Monitor SQL Data Sync with Azure Monitor logs](./monitor-tune-overview.md)
333
-
- Troubleshoot - [Troubleshoot issues with Azure SQL Data Sync]sql-data-sync-troubleshoot.md)
333
+
- Troubleshoot - [Troubleshoot issues with Azure SQL Data Sync](sql-data-sync-troubleshoot.md)
334
334
- Update the sync schema
335
335
- With Transact-SQL - [Automate replication of schema changes with SQL Data Sync in Azure](sql-data-sync-update-sync-schema.md)
336
336
- With PowerShell - [Use PowerShell to update the sync schema in an existing sync group](scripts/update-sync-schema-in-sync-group.md)
Copy file name to clipboardExpand all lines: azure-sql/database/sql-data-sync-best-practices.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.topic: conceptual
9
9
author: WilliamDAssafMSFT
10
10
ms.author: wiassaf
11
11
ms.reviewer: wiassaf, mathoma
12
-
ms.date: 12/20/2018
12
+
ms.date: 07/19/2022
13
13
---
14
14
# Best practices for Azure SQL Data Sync
15
15
@@ -20,25 +20,37 @@ This article describes best practices for Azure SQL Data Sync.
20
20
For an overview of SQL Data Sync, see [Sync data across multiple cloud and on-premises databases with Azure SQL Data Sync](sql-data-sync-data-sql-server-sql-database.md).
21
21
22
22
> [!IMPORTANT]
23
-
> Azure SQL Data Sync does **not** support Azure SQL Managed Instance at this time.
23
+
> Azure SQL Data Sync does **not** support Azure SQL Managed Instance or Azure Synapse Analytics at this time.
24
24
25
25
## <aname="security-and-reliability"></a> Security and reliability
26
26
27
27
### Client agent
28
28
29
29
- Install the client agent by using the least privileged user account that has network service access.
30
30
- Install the client agent on a computer that isn't the SQL Server computer.
31
-
- Don't register an on-premises database with more than one agent.
32
-
- Avoid this even if you are syncing different tables for different sync groups.
31
+
- Don't register an on-premises database with more than one agent.
32
+
- Avoid this even if you're syncing different tables for different sync groups.
33
33
- Registering an on-premises database with multiple client agents poses challenges when you delete one of the sync groups.
34
34
35
35
### Database accounts with least required privileges
36
36
37
-
-**For sync setup**. Create/Alter Table; Alter Database; Create Procedure; Select/ Alter Schema; Create User-Defined Type.
37
+
-**For sync setup**:
38
+
- SQL Server permissions: CREATE/ALTER TABLE, ALTER DATABASE, CREATE PROCEDURE, SELECT/ALTER SCHEMA, CREATE TYPE. These permissions are included (along with other permissions) in the built-in database role `ddl_admin`.
39
+
- At the resource group level, membership in the [SQL DB Contributor](/azure/role-based-access-control/built-in-roles#sql-db-contributor) role is necessary. For more information, see [Assign Azure roles using the Azure portal](/azure/role-based-access-control/role-assignments-portal). Membership in broader roles like Contributor or Owner work too, if already assigned.
40
+
- Permissions at the subscription level should not be needed, but could provide a simplified (though not *least required*) way to provide necessary permissions for multiple Azure Data Sync implementations in a subscription. An original, deprecated API required these [Azure RBAC permissions](/azure/role-based-access-control/resource-provider-operations), but should no longer be in use.
-**For ongoing sync**. Select/ Insert/ Update/ Delete on tables that are selected for syncing, and on sync metadata and tracking tables; Execute permission on stored procedures created by the service; Execute permission on user-defined table types.
45
+
-**For ongoing sync**.
46
+
- SQL Server permissions: SELECT, INSERT, UPDATE, and DELETE permission on user tables that are selected for syncing. EXECUTE permission on user-defined table types.
47
+
- SQL Server permissions: SELECT, INSERT, UPDATE, and DELETE permission on sync metadata and system-created tracking tables. EXECUTE permission on stored procedures created by the service.
48
+
- The `DataSync` schema is used for system-created objects in the hub and member databases.
49
+
- The `dss` and `TaskHosting` schemas are used for system-created objects in the sync metadata database.
40
50
41
-
-**For deprovisioning**. Alter on tables part of sync; Select/ Delete on sync metadata tables; Control on sync tracking tables, stored procedures, and user-defined types.
51
+
-**For deprovisioning**.
52
+
- SQL Server permissions: ALTER on all tables part of sync; SELECT and DELETE on sync metadata tables; CONTROL on sync tracking tables, stored procedures, and user-defined types.
53
+
- For cleanup, remove system-created objects in the `DataSync`, `dss`, and `TaskHosting` schemas.
42
54
43
55
Azure SQL Database supports only a single set of credentials. To accomplish these tasks within this constraint, consider the following options:
44
56
@@ -223,7 +235,7 @@ If you have a complex schema to sync, you may encounter an "operation timeout" d
223
235
224
236
#### Solution
225
237
226
-
To mitigate this issue, please scale up your sync metadata database to have a higher SKU, such as S3.
238
+
To mitigate this issue, consider scaling up your sync metadata database resources.
SQL Data Sync is a service built on Azure SQL Database that lets you synchronize the data you select bi-directionally across multiple databases, both on-premises and in the cloud.
21
23
22
24
> [!IMPORTANT]
23
-
> Azure SQL Data Sync does not support Azure SQL Managed Instance at this time.
25
+
> Azure SQL Data Sync does not support Azure SQL Managed Instance or Azure Synapse Analytics at this time.
24
26
25
27
26
28
## Overview
@@ -31,7 +33,7 @@ Data Sync uses a hub and spoke topology to synchronize data. You define one of t
31
33
32
34
- The **Hub Database** must be an Azure SQL Database.
33
35
- The **member databases** can be either databases in Azure SQL Database or in instances of SQL Server.
34
-
- The **Sync Metadata Database** contains the metadata and log for Data Sync. The Sync Metadata Database has to be an Azure SQL Database located in the same region as the Hub Database. The Sync Metadata Database is customer created and customer owned. You can only have one Sync Metadata Database per region and subscription. Sync Metadata Database cannot be deleted or renamed while sync groups or sync agents exist. 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.
36
+
- The **Sync Metadata Database** contains the metadata and log for Data Sync. The Sync Metadata Database has to be an Azure SQL Database located in the same region as the Hub Database. The Sync Metadata Database is customer created and customer owned. You can only have one Sync Metadata Database per region and subscription. Sync Metadata Database cannot be deleted or renamed while sync groups or sync agents exist. Microsoft recommends creating a new, empty database for use as the Sync Metadata Database. Data Sync creates tables in this database and runs a frequent workload.
35
37
36
38
> [!NOTE]
37
39
> If you're using an on premises database as a member database, you have to [install and configure a local sync agent](sql-data-sync-sql-server-configure.md#add-on-prem).
@@ -139,23 +141,24 @@ Provisioning and deprovisioning during sync group creation, update, and deletion
139
141
140
142
- Snapshot isolation must be enabled for both Sync members and hub. For more info, see [Snapshot Isolation in SQL Server](/dotnet/framework/data/adonet/sql/snapshot-isolation-in-sql-server).
141
143
142
-
- In order to use Data Sync private link, both the member and hub databases must be hosted in Azure (same or different regions), in the same cloud type (e.g. both in public cloud or both in government cloud). Additionally, to use private link, Microsoft.Network resource providers must be Registered for the subscriptions that host the hub and member servers. Lastly, you must manually approve the private link for Data Sync during the sync configuration, within the “Private endpoint connections” section in the Azure portal or through PowerShell. For more details on how to approve the private link, see [Set up SQL Data Sync](./sql-data-sync-sql-server-configure.md). Once you approve the service managed private endpoint, all communication between the sync service and the member/hub databases will happen over the private link. Existing sync groups can be updated to have this feature enabled.
144
+
- In order to use Data Sync private link, both the member and hub databases must be hosted in Azure (same or different regions), in the same cloud type (for example, both in public cloud or both in government cloud). Additionally, to use private link, `Microsoft.Network` resource providers must be Registered for the subscriptions that host the hub and member servers. Lastly, you must manually approve the private link for Data Sync during the sync configuration, within the "Private endpoint connections" section in the Azure portal or through PowerShell. For more information on how to approve the private link, see [Set up SQL Data Sync](./sql-data-sync-sql-server-configure.md). Once you approve the service managed private endpoint, all communication between the sync service and the member/hub databases will happen over the private link. Existing sync groups can be updated to have this feature enabled.
143
145
144
146
### General limitations
145
147
146
148
- A table can't have an identity column that isn't the primary key.
147
149
- A primary key can't have the following data types: sql_variant, binary, varbinary, image, xml.
148
150
- Be cautious when you use the following data types as a primary key, because the supported precision is only to the second: time, datetime, datetime2, datetimeoffset.
149
-
- The names of objects (databases, tables, and columns) can't contain the printable characters period (.), left square bracket ([), or right square bracket (]).
150
-
- A table name can't contain printable characters: ! " # $ % ' ( ) * + -space
151
+
- The names of objects (databases, tables, and columns) can't contain the printable characters period (`.`), left square bracket (`[`), or right square bracket (`]`).
152
+
- A table name can't contain printable characters: `! " # $ % ' ( ) * + -` or space.
151
153
- Azure Active Directory authentication isn't supported.
152
-
- If there are tables with the same name but different schema (for example, dbo.customers and sales.customers) only one of the tables can be added into sync.
153
-
- Columns with User-Defined Data Types aren't supported
154
+
- If there are tables with the same name but different schema (for example, `dbo.customers` and `sales.customers`) only one of the tables can be added into sync.
155
+
- Columns with user-defined data types aren't supported.
154
156
- Moving servers between different subscriptions isn't supported.
155
-
- If two primary keys are only different in case (e.g. Foo and foo), Data Sync won't support this scenario.
157
+
- If two primary keys are only different in case (for example, `Foo` and `foo`), Data Sync won't support this scenario.
156
158
- Truncating tables is not an operation supported by Data Sync (changes won't be tracked).
157
-
- Using a Hyperscale database as a Hub or Sync Metadata database is not supported. However, a Hyperscale database can be a member database in a Data Sync topology.
159
+
- Using an Azure SQL Hyperscale database as a Hub or Sync Metadata database is not supported. However, a Hyperscale database can be a member database in a Data Sync topology.
158
160
- Memory-optimized tables are not supported.
161
+
- Schema changes aren't automatically replicated. A custom solution can be created to [automate the replication of schema changes](./sql-data-sync-update-sync-schema.md).
159
162
160
163
#### Unsupported data types
161
164
@@ -191,7 +194,7 @@ Data Sync can't sync read-only or system-generated columns. For example:
191
194
> [!NOTE]
192
195
> If you use Sync private link, these network requirements do not apply.
193
196
194
-
When the sync group is established, the Data Sync service needs to connect to the hub database. At the time when you establish the sync group, the Azure SQL server must have the following configuration in its `Firewalls and virtual networks` settings:
197
+
When the sync group is established, the Data Sync service needs to connect to the hub database. When establishing the sync group, the Azure SQL server must have the following configuration in its `Firewalls and virtual networks` settings:
195
198
196
199
**Deny public network access* must be set to *Off*.
197
200
**Allow Azure services and resources to access this server* must be set to *Yes*, or you must create IP rules for the [IP addresses used by Data Sync service](network-access-controls-overview.md#data-sync).
@@ -230,9 +233,9 @@ Yes. You can configure sync between databases that belong to resource groups own
230
233
- If the subscriptions belong to the same tenant and you have permission to all subscriptions, you can configure the sync group in the Azure portal.
231
234
- Otherwise, you have to use PowerShell to add the sync members.
232
235
233
-
### Can I setup Data Sync to sync between databases in SQL Database that belong to different clouds (like Azure Public Cloud and Azure China 21Vianet)
236
+
### Can I set up Data Sync to sync between databases in SQL Database that belong to different clouds (like Azure Public Cloud and Azure China 21Vianet)
234
237
235
-
Yes. You can setup sync between databases that belong to different clouds. You have to use PowerShell to add the sync members that belong to the different subscriptions.
238
+
Yes. You can set up sync between databases that belong to different clouds. You have to use PowerShell to add the sync members that belong to the different subscriptions.
236
239
237
240
### Can I use Data Sync to seed data from my production database to an empty database, and then sync them
@@ -25,7 +25,7 @@ For an overview of SQL Data Sync, see [Sync data across cloud and on-premises da
25
25
For PowerShell examples on how to configure SQL Data Sync, see [How to sync between databases in SQL Database](scripts/sql-data-sync-sync-data-between-sql-databases.md) or [between databases in Azure SQL Database and SQL Server](scripts/sql-data-sync-sync-data-between-azure-onprem.md)
26
26
27
27
> [!IMPORTANT]
28
-
> SQL Data Sync does **not** support Azure SQL Managed Instance at this time.
28
+
> SQL Data Sync does **not** support Azure SQL Managed Instance or Azure Synapse Analytics at this time.
29
29
30
30
## Create sync group
31
31
@@ -223,9 +223,9 @@ When you change the data type of an existing column, Data Sync continues to work
223
223
224
224
**How can I export and import a database with Data Sync?**
225
225
226
-
After you export a database as a *.bacpac* file and import the file to create a database, do the following to use Data Sync in the new database:
226
+
After you export a database as a `.bacpac` file and import the file to create a database, do the following to use Data Sync in the new database:
227
227
228
-
1. Clean up the Data Sync objects and additional tables on the new database by using [this script](https://github.com/vitomaz-msft/DataSyncMetadataCleanup/blob/master/Data%20Sync%20complete%20cleanup.sql). The script deletes all the required Data Sync objects from the database.
228
+
1. Clean up the Data Sync objects and additional tables on the new database by using [Data Sync complete cleanup.sql](https://github.com/vitomaz-msft/DataSyncMetadataCleanup/blob/master/Data%20Sync%20complete%20cleanup.sql). The script deletes all the required Data Sync objects from the database.
229
229
1. Recreate the sync group with the new database. If you no longer need the old sync group, delete it.
230
230
231
231
**Where can I find information on the client agent?**
@@ -238,7 +238,7 @@ Yes, you must manually approve the service managed private endpoint, in the Priv
238
238
239
239
**Why do I get a firewall error when the Sync job is provisioning my Azure database?**
240
240
241
-
This may happen because Azure resources are not allowed to access your server. Ensure that the firewall on the Azure database has "Allow Azure services and resources to access this server” setting set to "Yes".
241
+
This may happen because Azure resources are not allowed to access your server. Ensure that the firewall on the Azure database has set "Allow Azure services and resources to access this server" to "Yes".
0 commit comments