Skip to content

Commit 05a895c

Browse files
authored
Merge pull request #23237 from WilliamDAssafMSFT/20220715-azure-sql-data-sync
20220715 elaborate permissions, synapse
2 parents c8633ee + 3509358 commit 05a895c

7 files changed

Lines changed: 67 additions & 39 deletions

azure-sql/database/scripts/sql-data-sync-sync-data-between-sql-databases-rest-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This REST API example configures SQL Data Sync to sync data between multiple dat
2525
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).
2626

2727
> [!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.
2929
3030
## Create sync group
3131

azure-sql/database/sql-data-sync-agent-overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ms.date: 12/20/2018
1919
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).
2020

2121
> [!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.
2323
2424
## Download and install
2525

@@ -70,7 +70,7 @@ To immediately invalidate or retire an agent, regenerate its key in the portal b
7070
If you want to run the local agent from a different computer than it is currently on, do the following things:
7171

7272
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.
7474
3. Use the new agent's UI to submit the new agent key.
7575
4. Wait while the client agent downloads the list of on-premises databases that were registered earlier.
7676
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
8181

8282
1. Select the Sync database.
8383
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**.
8585

8686
## <a name="agent-tshoot"></a> Troubleshoot Data Sync Agent issues
8787

@@ -161,7 +161,7 @@ You discover that the agent isn't running on a computer that hosts SQL Server. W
161161
1. In the **Password** box, enter your password.
162162
1. In the **Confirm Password** box, reenter your password.
163163
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**.
165165
1. Close the **Services** window.
166166

167167
### <a name="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:
330330
- [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)
331331
- Best practices - [Best practices for Azure SQL Data Sync](sql-data-sync-best-practices.md)
332332
- 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)
334334
- Update the sync schema
335335
- With Transact-SQL - [Automate replication of schema changes with SQL Data Sync in Azure](sql-data-sync-update-sync-schema.md)
336336
- With PowerShell - [Use PowerShell to update the sync schema in an existing sync group](scripts/update-sync-schema-in-sync-group.md)

azure-sql/database/sql-data-sync-best-practices.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.topic: conceptual
99
author: WilliamDAssafMSFT
1010
ms.author: wiassaf
1111
ms.reviewer: wiassaf, mathoma
12-
ms.date: 12/20/2018
12+
ms.date: 07/19/2022
1313
---
1414
# Best practices for Azure SQL Data Sync
1515

@@ -20,25 +20,37 @@ This article describes best practices for Azure SQL Data Sync.
2020
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).
2121

2222
> [!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.
2424
2525
## <a name="security-and-reliability"></a> Security and reliability
2626

2727
### Client agent
2828

2929
- Install the client agent by using the least privileged user account that has network service access.
3030
- 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.
3333
- Registering an on-premises database with multiple client agents poses challenges when you delete one of the sync groups.
3434

3535
### Database accounts with least required privileges
3636

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.
41+
- "Microsoft.Sql/locations/syncMemberOperationResults/read"
42+
- "Microsoft.Sql/locations/syncAgentOperationResults/read"
43+
- "Microsoft.Sql/locations/syncGroupOperationResults/read"
3844

39-
- **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.
4050

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.
4254

4355
Azure SQL Database supports only a single set of credentials. To accomplish these tasks within this constraint, consider the following options:
4456

@@ -223,7 +235,7 @@ If you have a complex schema to sync, you may encounter an "operation timeout" d
223235

224236
#### Solution
225237

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.
227239

228240
## Next steps
229241
For more information about SQL Data Sync, see:

azure-sql/database/sql-data-sync-data-sql-server-sql-database.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ ms.topic: conceptual
1313
author: WilliamDAssafMSFT
1414
ms.author: wiassaf
1515
ms.reviewer: wiassaf, mathoma
16-
ms.date: 2/2/2022
16+
ms.date: 07/15/2022
1717
---
1818
# What is SQL Data Sync for Azure?
1919

20+
[!INCLUDE[appliesto-sqldb](../includes/appliesto-sqldb.md)]
21+
2022
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.
2123

2224
> [!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.
2426
2527

2628
## Overview
@@ -31,7 +33,7 @@ Data Sync uses a hub and spoke topology to synchronize data. You define one of t
3133

3234
- The **Hub Database** must be an Azure SQL Database.
3335
- 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.
3537

3638
> [!NOTE]
3739
> 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
139141
140142
- 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).
141143

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.
143145

144146
### General limitations
145147

146148
- A table can't have an identity column that isn't the primary key.
147149
- A primary key can't have the following data types: sql_variant, binary, varbinary, image, xml.
148150
- 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.
151153
- 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.
154156
- 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.
156158
- 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.
158160
- 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).
159162

160163
#### Unsupported data types
161164

@@ -191,7 +194,7 @@ Data Sync can't sync read-only or system-generated columns. For example:
191194
> [!NOTE]
192195
> If you use Sync private link, these network requirements do not apply.
193196
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:
195198

196199
* *Deny public network access* must be set to *Off*.
197200
* *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
230233
- 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.
231234
- Otherwise, you have to use PowerShell to add the sync members.
232235

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)
234237

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.
236239

237240
### Can I use Data Sync to seed data from my production database to an empty database, and then sync them
238241

azure-sql/database/sql-data-sync-sql-server-configure.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.topic: tutorial
1111
author: WilliamDAssafMSFT
1212
ms.author: wiassaf
1313
ms.reviewer: wiassaf, mathoma
14-
ms.date: 01/14/2019
14+
ms.date: 07/16/2022
1515
---
1616
# Tutorial: Set up SQL Data Sync between databases in Azure SQL Database and SQL Server
1717
[!INCLUDE[appliesto-sqldb](../includes/appliesto-sqldb.md)]
@@ -25,7 +25,7 @@ For an overview of SQL Data Sync, see [Sync data across cloud and on-premises da
2525
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)
2626

2727
> [!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.
2929
3030
## Create sync group
3131

@@ -223,9 +223,9 @@ When you change the data type of an existing column, Data Sync continues to work
223223

224224
**How can I export and import a database with Data Sync?**
225225

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:
227227

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.
229229
1. Recreate the sync group with the new database. If you no longer need the old sync group, delete it.
230230

231231
**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
238238

239239
**Why do I get a firewall error when the Sync job is provisioning my Azure database?**
240240

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".
242242

243243

244244
## Next steps

0 commit comments

Comments
 (0)