Courseiva

DP-300 Configure and manage automation of tasks Practice Question

You are the database administrator for a logistics company that uses Azure SQL Database. You need to automate the execution of a T-SQL script that rebuilds fragmented indexes every night at 2:00 AM. You want to minimize administrative overhead and avoid managing a separate virtual machine. What should you use?

⚠ Common exam trap

The trap here is assuming that any automation tool that can run T-SQL is equally appropriate, overlooking that Elastic Jobs are purpose-built for Azure SQL Database and eliminate extra infrastructure.

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 an Elastic Job agent and define a job step that runs the T-SQL script on a schedule.

Elastic Jobs are the native automation feature for Azure SQL Database, allowing scheduled T-SQL execution without external compute. They support recurring schedules, target databases, and credential management, directly satisfying the need to run an index rebuild nightly at 2:00 AM with minimal administrative effort. Other options either require additional infrastructure or are not available for Azure SQL Database.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Configure a SQL Server Agent job on an Azure virtual machine that connects to the database.

    Why it's wrong here

    SQL Server Agent is not available in Azure SQL Database; it is a feature of SQL Server and Azure SQL Managed Instance. Deploying and maintaining a separate VM solely to run an agent job introduces unnecessary cost and management effort. This approach contradicts the goal of minimizing administrative overhead and avoiding a separate VM.

  • ✗

    Deploy an Azure Automation runbook that connects to the database and executes the script.

    Why it's wrong here

    Azure Automation runbooks can run T-SQL, but they require creating and managing an Automation account, credentials, and often a Hybrid Runbook Worker or Azure SQL authentication setup. This adds administrative overhead compared to a native database feature. The scenario explicitly asks to minimize overhead and avoid managing separate infrastructure, so a runbook is not the best fit here.

  • ✗

    Use Azure Logic Apps with a recurrence trigger and a SQL Server connector to run the script.

    Why it's wrong here

    Logic Apps can schedule and execute SQL commands, but they require building a workflow, managing connections, and handling authentication. While serverless, it is a separate Azure resource to configure and monitor. For a simple nightly T-SQL script, Elastic Jobs provide a more direct, database-native scheduling mechanism with less setup and no external workflow design.

  • ✓

    Create an Elastic Job agent and define a job step that runs the T-SQL script on a schedule.

    Why this is correct

    Elastic Jobs are a built-in Azure SQL Database feature designed to automate T-SQL execution across one or more databases on a schedule. You configure a job with a step containing the index rebuild script, set a schedule for 2:00 AM, and the service handles execution without needing a VM or external orchestrator. This directly meets the requirement with minimal overhead.

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 →

How Courseiva writes practice questions · Editorial policy

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.