Automate Index Maintenance in Azure SQL Database: Native Options
Which TWO of the following are native options to automate index maintenance on Azure SQL Database? (Select exactly two.)
Quick Answer
The answer is enabling automatic tuning with 'CREATE INDEX' and 'DROP INDEX' options, along with Elastic Database Jobs. These are the two native options to automate index maintenance in Azure SQL Database because automatic tuning uses built-in intelligence to continuously analyze query performance and automatically create or drop indexes as needed, while Elastic Database Jobs allow you to schedule and run custom T-SQL scripts for index maintenance across multiple databases. On the Microsoft Azure Database Administrator Associate DP-300 exam, this question tests your understanding of what is natively available versus what requires external tools—a common trap is assuming SQL Agent works in Azure SQL Database, but it is only available on SQL Server and Azure SQL Managed Instance. Remember that Azure SQL Database lacks SQL Agent, so for automation you rely on automatic tuning for index management and Elastic Jobs for custom scripts. A helpful memory tip: think "auto-tune for auto-index, Elastic Jobs for manual scripts."
⚠ Common exam trap
DP-300 often tests the misconception that SQL Agent is available in Azure SQL Database — it is not; candidates must recognize that Elastic Jobs and automatic tuning are the native automation paths, while SQL Agent belongs to Managed Instance or SQL Server on VMs.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create Elastic Database Jobs that run index maintenance T-SQL scripts.
Option A is correct because Elastic Database Jobs are a native Azure SQL Database feature that lets you define and schedule T-SQL scripts (such as ALTER INDEX ... REBUILD/REORGANIZE) across one or many databases without needing an external orchestrator. Option C is correct because Azure SQL Database's built-in automatic tuning can automatically create and drop indexes based on workload analysis, which is a native, server-side index maintenance capability. Option B is not native to Azure SQL Database: Azure Automation is a separate Azure service, and its PowerShell runbooks must connect externally to run T-SQL. Option D is wrong because SQL Server Agent is not available in Azure SQL Database (it exists in Azure SQL Managed Instance and SQL Server on Azure VMs). Option E is wrong because Azure Data Factory is a data integration/ETL service, not an index maintenance mechanism.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Create Elastic Database Jobs that run index maintenance T-SQL scripts.
Why this is correct
Elastic Database Jobs execute T-SQL across Azure SQL Database instances on a schedule, satisfying the requirement for a native automation mechanism. Unlike SQL Server Agent, which Azure SQL Database lacks, elastic jobs run index rebuild and reorganise scripts directly against the target databases without external tooling.
- ✗
Use Azure Automation PowerShell runbooks to invoke index rebuilds.
Why it's wrong here
Azure Automation runbooks are not a native index-maintenance mechanism for Azure SQL Database; they are a general orchestration service. It is tempting because Automation can schedule PowerShell against many Azure resources, which suits cross-service administration rather than database-native maintenance tasks.
- ✓
Enable automatic tuning with 'CREATE INDEX' and 'DROP INDEX' options.
Why this is correct
Automatic tuning applies CREATE INDEX and DROP INDEX recommendations directly on Azure SQL Database, satisfying the requirement for a native, platform-managed maintenance mechanism without external tooling or agent jobs. It continuously analyses workload patterns and validates changes, reverting harmful indexes automatically.
- ✗
Schedule SQL Agent jobs with ALTER INDEX statements.
Why it's wrong here
SQL Agent is unavailable in Azure SQL Database, so ALTER INDEX jobs cannot be scheduled there; that facility exists only in SQL Server and Managed Instance. It is tempting because Agent jobs are the standard on-premises maintenance approach, making them the natural first answer for DBAs.
- ✗
Use Azure Data Factory to copy data and rebuild indexes.
Why it's wrong here
Azure Data Factory performs data movement and orchestration, not index rebuilds, so it cannot maintain indexes. It is tempting because Data Factory pipelines can invoke stored procedures, which suits ETL and data integration workloads rather than routine index maintenance.
Go deeper
Related to this question
Learn chapter
Overview of Azure Data Platform Options
Key term
Azure SQL Performance Tuning
Azure SQL Performance Tuning is the process of optimizing the speed and efficiency of queries and database operations in Microsoft Azure SQL Database or SQL Managed Instance to reduce latency and improve throughput.
Key term
Azure SQL Managed Instance
Azure SQL Managed Instance is a fully managed cloud database service that gives you nearly all the features of Microsoft SQL Server on your own server, without you having to manage the hardware or operating system.
About these practice questions
Courseiva writes every DP-300 question from scratch — 574 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on DP-300
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. You are configuring automated performance tuning for an Azure SQL Database. You want to automatically create missing indexes and drop unused indexes, but you need to prevent automatic index creation during peak business hours (9 AM - 5 PM). What is the best approach?
hard- A.Enable automatic indexing in Azure SQL Database and rely on the system to decide when to create indexes.
- ✓ B.Enable automatic tuning but set the 'INDEX_CREATE' option to 'OFF' and use a schedule to run a script that enables it during off-peak hours and disables during peak hours.
- C.Use SQL Server Agent to schedule index creation scripts that check for missing indexes.
- D.Use Azure Automation to run index analysis scripts only during off-peak hours.
Why B: It leverages Azure SQL Database's built-in automatic tuning feature while still allowing you to enforce a schedule. By setting the 'INDEX_CREATE' option to 'OFF' and using a script (e.g., via Azure Automation or SQL Server Agent) to toggle it on during off-peak hours and off during peak hours, you can automatically create missing indexes outside the prohibited window. This approach combines the intelligence of automatic tuning with your scheduling requirement. Option A does not allow scheduling; Option C relies on manual scripts without the built-in tuning intelligence; Option D is similar to B but less integrated with automatic tuning.
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Microsoft exam blueprint
This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.