How can I Schedule a Sql job in Microsoft Azure SQL database?

user1006544 picture user1006544 · Dec 5, 2014 · Viewed 37.5k times · Source

I have one SQL Agent maintenance job which checks the index fragmentation within a database and rebuilds indexes if required.

This is running well in my test server (Microsoft Sql Server 2012). But my production server is in Azure. Now I want to schedule that job to Azure.

SQL Agent does not exist in Azure SQL database so how can I schedule a Sql Job in Azure Db?

Answer

David Yates picture David Yates · Jan 3, 2018

Since this question was first asked, there is now another alternative to handle this problem:
Azure Functions

Here are a couple of examples that could easily be modified to call a stored procedure that rebuilds your indexes

Also see

A few things to keep in mind with Azure functions