Search code examples
azureazure-sql-databasesql-job

Azure - Schedule SQL Job


I'm in the process of creating a small Azure site consisting of the following

  • Website
  • SQL Database

The website supports user accounts and licensing. I plan on handling the licensing checks via a scheduled SQL service (Much like a SQL agent in SQL Server) once a day.

What are my options here?


Solution

  • If you are using an Azure SQL Database (which I assume you are), then you don't have the SQL Server Agent.

    You do however have 2 possible options for your needs:

    1. Using Azure Automation, you can use PowerShell to do your scheduled tasks. More info and a sample here. Azure Automation is the surrogate for the SQL Agent if you ask me.
    2. The other option is Azure WebJobs. I think this is the way to go, as you are already using Azure WebSites and this comes as a feature of it. Scott Hanselman has an excellent blog post about it.