Using Azure Function to execute Tasks set in multiple different date and time

Julius Bacosa 1 Reputation point

Hello, we have a Database table in Sql Server with a list of Schedules, we call it ExportSchedules.

so each ExportSchedule has its own ExportDate and ExportTime and can also be a recurring Job.

how do we use Azure Function to trigger an Export (get the necessary data from database and, convert this to csv and send to email) base
on the set schedules on the Table records?

ExportSchedules can have thousands of Schedules.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,371 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,883 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 69,421 Reputation points

    Hi @Julius Bacosa

    Azure function has timer trigger that runs your function on a schedule. But in your case, it cannot be used as a standalone for your requirement. You can have a timer trigger function that keeps on running on schedule time (let's take every 5 min or according to your need) and you need to write your business logic which talks to the SQL server and get the list of schedule that is scheduled and return to the function app. Now you have the list of jobs that need to be triggered you can create/call another function (HTTP trigger function) which will talk to the SQL server to execute that job and return the output. Now you can write your own logic to convert the result set to CSV. Once the CSV file is created you can leverage Send Grid to send email.

    Similarly, you can also use logic app job schedular which has CreateTimerJob LogicApp: Logic App definition that acts as an API to create new timer jobs based on a provided recurring schedule, and TimerJob LogicApp: Executes the prescribed job on the schedule provided.

    There are no out of box solution but writing your custom logic and using different services can help you.

    0 comments No comments