Azure Functions Sync Database

This Azure Function is a timer-triggered function that synchronizes data from a source database to a destination database at regular intervals

 

 

Attribute [TimerTrigger("0 */5 * * * *")] sets the function to run every 5 minutes using a CRON expression.

So, the function automatically executes on a schedule — no need for manual calls or external triggers.

 

Dependencies Used

  • Dapper: lightweight ORM to simplify SQL queries and object mapping.
  • Microsoft.Data.SqlClient: SQL Server database connectivity.
  • Azure Functions TimerTrigger: to run on schedule.

 

 

Summary
This Azure Function runs every 5 minutes to automatically sync data from one SQL database to another by:

  • Fetching unprocessed records,
  • Inserting them into the target,
  • Logging progress or errors..

 

 

Other User Cases

  • Update Sales Dashboard
  • Flatten and Insert Data

Related Question