0
votes

I have an Azure SQL Database I have Azure SQL Data Sync that syncs that data to an on prem sql database

I want to call the sync group to execute instead of waiting for the sql data sync time to occur. Mainly because i dont want the sync to happen during a bulk insert.

my idea is to use a logic app to monitor a bulk insert and call the sql data sync but that isnt that easy

i see that LA can be activated on db changes

https://docs.microsoft.com/en-us/azure/connectors/connectors-create-api-sqlazure

i see there is supposed to be a rest api for data sync

https://azure.microsoft.com/nb-no/blog/azure-sql-data-sync-refresh/ (but i dont find any documentation on this)

i see a powershell script that i could use (maybe)

https://docs.microsoft.com/en-us/azure/azure-sql/database/scripts/sql-data-sync-sync-data-between-azure-onprem

but... having i dont see an easy way to wire this all together as i dont see LA using powershell, i dont see SDS using rest, so no posting from LA.

If anyone has a better idea then please let me know. Its important to wait until a bulk insert of a table is complete before a sync starts to avoid errors. the data is only flowing from Azure to on prem.

1

1 Answers

0
votes

By call the the sync group , I think you want to trigger the sync group :

The below REST API can be used in order to trigger the Sync

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync?api-version=2015-05-01-preview

Reference : https://docs.microsoft.com/en-us/rest/api/sql/syncgroups/triggersync

You could use HTTP Connector and with the required Headers hit the above endpoint

enter image description here