如何配置Azure同步实现源库删除记录同步至Azure数据库?
Hey there! Let's work through your Azure SQL Data Sync issues since you're already halfway there with syncing inserts/updates—great job getting that far!
Why aren't deletions syncing from local SQL Server to Azure?
Here are the most common configuration gaps that cause deletion sync failures:
"Sync deletions" setting is disabled
When you created or edited your sync group, there's a critical option called Sync deletions that controls whether delete operations are propagated across the sync group. By default, this might be turned off. Head to your sync group settings in the Azure Portal, find this option, and set it toTrue(or check the corresponding box).Table-level sync doesn't include deletions
Even if the sync group has deletion sync enabled, individual tables might have this overridden. When you added tables to the sync group, double-check each table's configuration—there should be a toggle or checkbox for including delete operations in sync. Make sure this is enabled for all tables where you need deletions to sync.Sync Agent tracking tables are misconfigured
The Sync Agent creates tracking tables (with names starting like__Sync*) in your local production database to log all data changes, including deletions. If these tables don't exist, have incorrect permissions, or aren't capturing delete events, the sync process won't pick up deletions. Verify these tables exist and that the Sync Agent service account has full read/write permissions to them.Sync direction is incorrectly set
Ensure your sync direction is set to One-way: Local SQL Server to Azure SQL Database. If it's set to a different direction (like Azure to local) or if you accidentally limited sync to only inserts/updates, deletions won't be pushed to Azure.
Is using the "Sync to other databases" tool the right approach?
Short answer: Yes, that's exactly the tool you should be using—it's the official Azure SQL Data Sync feature you're already leveraging with your sync group and agent. The problem isn't the tool itself, it's the missing configuration we covered above. You don't need to switch to a different tool; adjusting your existing sync group settings will fix the deletion sync issue.
Quick troubleshooting steps to verify:
- Trigger a manual sync from the Azure Portal sync group page.
- Check the Sync History tab for any error messages related to deletion operations—this will give you specific clues if there's a permission or tracking issue.
- Ensure your Sync Agent is running the latest version (you can update it from the Azure Portal's Sync Agents page) to avoid any known bugs with deletion sync.
内容的提问来源于stack exchange,提问作者landrew

