You are tasked with automating index maintenance for an Azure SQL Database. Which Azure service should you use to run T-SQL scripts on a recurring schedule?
Trap 1: SQL Server Agent
SQL Server Agent is unavailable in Azure SQL Database, so no Agent job can be created there. It is the correct scheduler for index maintenance on Azure SQL Managed Instance or a SQL Server VM, where the Agent service actually exists.
Trap 2: Azure Automation Runbook
Azure Automation Runbooks execute PowerShell or Python workflows, not T-SQL directly against Azure SQL Database on a schedule; they lack a native T-SQL job step. They suit orchestrating cross-service automation, such as scaling or VM operations, where no database-native scheduler exists.
Trap 3: Azure Logic Apps
Logic Apps orchestrate connectors and workflows triggered by events or schedules, but they do not natively execute T-SQL index maintenance scripts as scheduled jobs. They fit integrating systems, for example reacting to a file upload, rather than database-internal maintenance.
- A
SQL Server Agent
Why it fails: SQL Server Agent is unavailable in Azure SQL Database, so no Agent job can be created there. It is the correct scheduler for index maintenance on Azure SQL Managed Instance or a SQL Server VM, where the Agent service actually exists.
- B
Elastic Database Jobs
Elastic Database Jobs run T-SQL against Azure SQL Database on a defined recurrence, satisfying the scheduled index-maintenance requirement. Unlike SQL Agent, which is unavailable in Azure SQL Database, elastic jobs target logical servers and databases directly, executing scripts such as index rebuilds without external orchestration.
- C
Azure Automation Runbook
Why it fails: Azure Automation Runbooks execute PowerShell or Python workflows, not T-SQL directly against Azure SQL Database on a schedule; they lack a native T-SQL job step. They suit orchestrating cross-service automation, such as scaling or VM operations, where no database-native scheduler exists.
- D
Azure Logic Apps
Why it fails: Logic Apps orchestrate connectors and workflows triggered by events or schedules, but they do not natively execute T-SQL index maintenance scripts as scheduled jobs. They fit integrating systems, for example reacting to a file upload, rather than database-internal maintenance.