Courseiva

CCNA Configure and manage automation of tasks Questions

75 of 83 questions · Page 1/2 · Configure and manage automation of tasks · Answers revealed

1
MCQhard

You are configuring an elastic job in Azure SQL Database to run a T-SQL script on all databases within an elastic pool. The script must run on a schedule. You have already created the job agent, job, and target group. You need to ensure that the job step executes against every database in the pool, including databases added later. What should you configure for the target group?

A.Set the target group to include the logical server, and set the job step to target that group.
B.Add each database individually to the target group and update the group when new databases are added.
C.Set the target group to include the elastic pool, and set the job step to target that group.
D.Create a separate job for each database and schedule them individually.
AnswerC

Elastic job target groups can include an elastic pool as a target. When the job runs, the agent enumerates all databases in the pool at that time, so databases added later are automatically included. This satisfies the requirement to run on all current and future databases without manual updates.

Why this answer

Elastic job target groups can be defined at the elastic pool level. When the job executes, the agent resolves the target group to the current set of databases in the pool, so any database added afterward is included automatically. This provides dynamic, scalable targeting without manual updates.

Exam trap

The trap here is assuming that target groups are static lists, when they can be dynamic by targeting an elastic pool or server, which automatically includes new databases.

2
Multi-Selecthard

Which THREE actions can be performed by using Elastic Database Jobs in Azure SQL Database? (Choose three.)

Select 3 answers
A.Run a T-SQL script to update statistics across multiple databases.
B.Collect metadata about databases and store it in a table.
C.Create a new Azure SQL Database.
D.Change the service tier objective (SLO) of a database.
E.Rebuild indexes on all databases in an elastic pool.
AnswersA, B, E

Elastic Database Jobs run T-SQL against a target group of databases, so a statistics-update script can execute across many Azure SQL databases from one job definition. This satisfies the stem's requirement for cross-database administrative scripting.

Why this answer

Elastic Database Jobs in Azure SQL Database are designed to run T-SQL scripts against a target group of databases, so option A is correct: a job can execute a T-SQL script that runs UPDATE STATISTICS across multiple databases in the target group. Option B is correct because jobs can run T-SQL that queries catalog views such as sys.databases and sys.dm_db_resource_stats and inserts the results into a table for centralized metadata collection. Option E is correct because index maintenance, including ALTER INDEX ...

REBUILD, is a T-SQL operation that can be executed by a job against every database in an elastic pool used as the job target. Option C is not correct because creating a new Azure SQL Database is a control-plane operation performed through the Azure portal, PowerShell, CLI, or REST API, not through the T-SQL execution model of Elastic Database Jobs. Option D is not correct because changing the service tier objective (SLO) is also a management/control-plane action, not a T-SQL statement that Elastic Database Jobs can run against target databases.

Exam trap

The trap here is that candidates may assume Elastic Database Jobs can perform any administrative task, but they are strictly limited to executing T-SQL scripts and cannot perform resource-level operations like creating databases or changing service tiers.

3
MCQhard

You are a database administrator for a healthcare company that uses Azure SQL Managed Instance. The company requires that a T-SQL script run every night to perform index maintenance on a specific database. You need to configure an automated solution that uses SQL Server Agent. Which of the following must you do to enable SQL Server Agent jobs on the managed instance?

A.Create a SQL Server Agent job using T-SQL or SQL Server Management Studio.
B.Configure Azure Automation to run the T-SQL script and invoke it from a SQL Server Agent job.
C.Enable the 'Agent XPs' advanced option using sp_configure.
D.Enable the SQL Server Agent service on the managed instance.
AnswerA

On Azure SQL Managed Instance, SQL Server Agent is available and you can create jobs using T-SQL stored procedures in the msdb database or via SQL Server Management Studio. The agent runs automatically, so you simply define the job, steps, and schedule. This is the correct method to automate T-SQL scripts on a schedule.

Why this answer

SQL Server Agent is fully supported on Azure SQL Managed Instance and is always running. You create jobs using T-SQL or SSMS, and the agent executes them on schedule. No additional configuration or external services are needed.

The other options either misstate the agent's availability or suggest unnecessary steps that are not applicable to managed instances.

Exam trap

The trap here is thinking that SQL Server Agent needs to be enabled or that Azure Automation is required, when on Azure SQL Managed Instance it is already available and managed by the platform.

4
MCQeasy

You need to automate the deployment of an Azure SQL Database and its schema to multiple environments (dev, test, prod) using a repeatable process. The solution must support version control and CI/CD integration. What should you use?

A.Azure Automation runbooks that execute sqlcmd scripts
B.Azure DevOps Pipelines with a DACPAC deployment task
C.Azure Data Factory with a copy activity
D.Azure Logic Apps with a SQL Server connector
AnswerB

Azure DevOps Pipelines can integrate with source control to automatically build and deploy a DACPAC (Data-tier Application Package) to Azure SQL Database. The DACPAC contains the schema and can be deployed using SqlPackage.exe. This supports version control, continuous integration, and continuous deployment, making it ideal for repeatable multi-environment deployments. It aligns with DevOps practices and automates the entire process.

Why this answer

Azure DevOps Pipelines with a DACPAC deployment task provide a robust CI/CD solution for deploying Azure SQL Database schemas. The DACPAC encapsulates the schema, and pipelines integrate with Git for version control. This enables automated, repeatable deployments across multiple environments with minimal manual intervention, aligning with DevOps best practices.

Exam trap

The trap here is assuming that any automation tool can handle schema deployment, but only DACPAC-based pipelines provide built-in version control and CI/CD integration.

5
MCQhard

You are designing an automated backup strategy for Azure SQL Managed Instance. The solution must ensure point-in-time restore (PITR) within 2 hours for the last 7 days and long-term retention (LTR) for 5 years. Which configuration should you use?

A.Use Azure Backup for SQL Server in Azure VM to back up the managed instance.
B.Set PITR retention to 7 days and use geo-redundant backup storage for LTR.
C.Set PITR retention to 2 hours and configure a custom backup job using Elastic Database Jobs.
D.Set PITR retention to 7 days (default) and configure LTR backup policy with yearly backups for 5 years.
AnswerD

PITR retention governs the point-in-time restore window, so 7 days meets the 2-hour PITR requirement for the last week. LTR policies separately retain yearly backups for 5 years, satisfying the stem's long-term retention constraint without extending PITR.

Why this answer

Azure SQL Managed Instance supports point-in-time restore (PITR) with a configurable retention period from 1 to 35 days; the default is 7 days, which satisfies the requirement to restore within 2 hours for the last 7 days (the 2-hour target is a recovery point objective, not retention). For long-term retention (LTR) of 5 years, Managed Instance supports LTR backup policies with yearly backups that can retain backups for up to 10 years. Therefore, setting PITR retention to 7 days (default) and configuring an LTR policy with yearly backups for 5 years meets both requirements.

Option A is wrong because Azure Backup for SQL Server in Azure VM is for SQL Server on Azure VMs, not for Managed Instance. Option B is wrong because "geo-redundant backup storage for LTR" is a storage redundancy option, not an LTR retention policy; LTR requires explicit backup frequency and retention configuration. Option C is wrong because PITR retention cannot be set to 2 hours (minimum is 1 day) and custom backup jobs using Elastic Database Jobs are unnecessary; Managed Instance automates backups natively.

6
Multi-Selecteasy

You are tasked with automating the backups of multiple Azure SQL Databases to ensure long-term retention. Which ONE Azure service can be used to achieve automated backups with retention beyond the default 7-35 days?

Select 1 answer
A.Azure Site Recovery
B.Azure Blob Storage snapshots
C.Azure Backup for SQL Server in Azure VMs
D.Azure Storage lifecycle management
E.Azure SQL Database long-term retention (LTR) backup policy
AnswersE

Azure SQL Database long-term retention (LTR) backup policy extends automated backups to up to 10 years, satisfying the requirement for retention beyond the default 7–35 days. LTR stores full backups in Azure Blob storage as read-only copies, independent of the standard retention window, with no manual intervention needed.

Why this answer

Only Azure SQL Database long-term retention (LTR) backup policy provides automated long-term backup retention for Azure SQL Database (PaaS), allowing retention beyond the default 7-35 days up to 10 years. Option C (Azure Backup for SQL Server in Azure VMs) is for SQL Server on Azure VMs (IaaS), not for Azure SQL Database, so it does not apply. The other options (A, B, D) do not provide automated backup with long-term retention for Azure SQL Database.

7
Multi-Selecteasy

Which TWO tools can be used to automate the deployment of database schema changes to Azure SQL Database as part of a CI/CD pipeline? (Choose two.)

Select 2 answers
A.Azure Data Studio with SQLCMD mode
B.GitHub Actions with the Azure SQL Database deployment action
C.Azure DevOps release pipeline with SQL Server database project (DACPAC) deployment task
D.SQL Server Import and Export Wizard
E.SQL Server Management Studio (SSMS)
AnswersB, C

GitHub Actions orchestrates pipeline jobs, and the Azure SQL Database deployment action connects to the server and applies schema changes via SqlPackage. This satisfies the CI/CD automation constraint by executing DACPAC or SQL script deployment against Azure SQL Database on each pipeline run.

Why this answer

Option B is correct because GitHub Actions provides the 'Azure SQL Database deployment' action (azure/sql-action), which executes scripts or DACPAC/BACPAC deployments against Azure SQL Database as an automated pipeline step. Option C is correct because an Azure DevOps release pipeline can use the 'Azure SQL Database deployment' task (SqlAzureDacpacDeployment) to deploy a SQL Server database project's DACPAC, applying schema changes automatically during CI/CD. Option A is not a pipeline automation tool; Azure Data Studio with SQLCMD mode is an interactive client for running scripts manually.

Option D, the Import and Export Wizard, only moves data between sources and does not manage schema versioning or pipeline deployment. Option E, SSMS, is a manual GUI administration tool and does not itself automate CI/CD schema deployment.

Exam trap

The trap is selecting manual tools like SSMS or Azure Data Studio, which are not automation tools for CI/CD pipelines; candidates must focus on tools that integrate with pipeline systems.

8
MCQhard

You have an Azure SQL Database that uses a failover group for high availability. You need to automate the failover to the secondary region during a planned maintenance window. What is the best approach?

A.Use Azure CLI or PowerShell to invoke planned failover
B.Create an Azure Automation runbook that uses REST API
C.Schedule an Elastic Database Job to execute a failover script
D.Configure Azure Traffic Manager to route traffic to secondary
AnswerA

Planned failover via Azure CLI or PowerShell performs a controlled switchover with zero data loss, letting you schedule it inside the maintenance window. It gracefully drains the primary before promoting the secondary, unlike an unplanned forced failover.

Why this answer

Using Azure CLI or PowerShell to invoke a planned failover is the best approach because it provides a direct, scriptable, and auditable method to trigger failover during a planned maintenance window. Planned failover ensures no data loss by synchronizing all pending changes before switching, and it can be automated via scripts in Azure DevOps or other orchestration tools. This meets the requirement for automation during a planned window with minimal complexity.

Exam trap

The trap is confusing traffic routing (Traffic Manager) or generic job scheduling (Elastic Jobs) with the actual database failover operation; candidates must recognize that planned failover requires a direct database control-plane command, not a DNS or job-based workaround.

How to eliminate wrong answers

Option B is wrong because while an Azure Automation runbook using REST API can invoke failover, it is more complex and indirect than using native CLI/PowerShell cmdlets; it adds unnecessary overhead for a planned failover. Option C is wrong because Elastic Database Jobs are designed for running T-SQL scripts across multiple databases, not for orchestrating geo-failover of a failover group; they lack the necessary permissions and cmdlets for failover operations. Option D is wrong because Azure Traffic Manager is a DNS-based traffic routing service that can redirect clients to the secondary region, but it does not perform the actual database failover; it only routes traffic, leaving the database in a non-failed-over state.

9
MCQmedium

You are a database administrator for a financial services company that uses Azure SQL Database. The company requires that all administrative tasks, such as index maintenance and statistics updates, be automated and run on a schedule. You need to implement a solution that uses T-SQL scripts and runs them on a schedule without requiring an external server. What should you use?

A.Azure Functions with timer trigger
B.Elastic Database jobs
C.SQL Server Agent
D.Azure Automation runbooks
AnswerB

Elastic Database jobs in Azure SQL Database allow you to run T-SQL scripts against a target group of databases on a schedule. They are a built-in feature of Azure SQL Database and do not require an external server or agent. This makes them ideal for automating administrative tasks like index maintenance and statistics updates across one or many databases.

Why this answer

Elastic Database jobs are a native Azure SQL Database feature that enables scheduling and execution of T-SQL scripts across databases. They require no external compute or agent, simplifying automation of routine administrative tasks. Other options either are not available in Azure SQL Database or require additional infrastructure and code, making them less suitable for this scenario.

Exam trap

The trap here is assuming that SQL Server Agent is available in Azure SQL Database, when it is only supported in SQL Server and Azure SQL Managed Instance.

10
MCQmedium

You have an Azure SQL Managed Instance. You need to automate the execution of a stored procedure every hour to clean up historical data. What is the most appropriate solution?

A.SQL Agent Job
B.Azure Logic Apps with SQL connector
C.Elastic Database Job
D.Azure Automation runbook with T-SQL
AnswerA

SQL Agent Jobs are the native scheduling mechanism in Azure SQL Managed Instance, supporting recurring T-SQL steps such as executing a stored procedure hourly. Unlike Azure Automation or Elastic Jobs, it runs in-instance with no external orchestrator, satisfying the hourly cleanup requirement directly.

Why this answer

SQL Agent Jobs are a built-in feature of Azure SQL Managed Instance, providing native scheduling for T-SQL jobs like executing a stored procedure every hour. Option B is less appropriate because Azure Logic Apps is an external service that adds complexity and latency. Option C is designed for executing tasks across multiple databases, not a single instance.

Option D is external and less integrated compared to the native SQL Agent Job.

11
Multi-Selectmedium

Which TWO actions can you perform using Elastic Database Jobs in Azure SQL Database?

Select 2 answers
A.Add a firewall rule to allow access from a specific IP address.
B.Schedule a job to rebuild indexes on a set of databases.
C.Create users in Microsoft Entra ID for database access.
D.Automatically scale the service tier of a database based on CPU usage.
E.Run a T-SQL script to update statistics on all databases in an elastic pool.
AnswersB, E

Elastic Database Jobs run T-SQL on a defined target group, so scheduling index rebuilds across a set of databases is a supported maintenance scenario. This satisfies the stem by automating recurring index maintenance without per-database scripting.

Why this answer

Options B and E are correct. Elastic Database Jobs in Azure SQL Database allow you to schedule and run T-SQL scripts across multiple databases, including those in an elastic pool. You can use them to schedule index rebuilding (B) and to update statistics via T-SQL (E).

Option A is incorrect because firewall rules are managed through Azure SQL Server firewall settings, not Elastic Database Jobs. Option C is incorrect because creating users in Microsoft Entra ID (formerly Azure AD) is done through Active Directory, not Elastic Database Jobs. Option D is incorrect because scaling service tiers is an administrative operation handled by Azure SQL Database scaling commands or automation, not by Elastic Database Jobs.

12
MCQeasy

You administer an Azure SQL Database for a ticketing platform. A nightly Azure Automation runbook must scale the database between the General Purpose and Business Critical service tiers based on the day of the week. The runbook runs under a system-assigned managed identity. Which cmdlet should the runbook use to change the service tier?

A.New-AzSqlDatabase
B.Set-AzSqlDatabase
C.Set-AzSqlDatabaseInstance
D.Update-AzSqlServer
AnswerB

Set-AzSqlDatabase modifies properties of an existing Azure SQL Database, including the requested service objective and edition via parameters such as -RequestedServiceObjectiveName. Using it with the managed identity's authenticated Az context changes the tier without recreating the database, which is exactly what the nightly scaling runbook requires.

Why this answer

Changing the service tier of an existing Azure SQL Database is an update operation on the database resource, which the Az PowerShell module exposes through Set-AzSqlDatabase. The runbook authenticates with its managed identity, obtains an Az context, and calls the cmdlet with the desired edition and service objective. Creation and server-level cmdlets cannot perform this in-place scaling.

Exam trap

The trap here is reaching for a creation cmdlet or a server-level cmdlet when the operation is an in-place modification of an existing database resource.

13
MCQmedium

You are reviewing an ARM template snippet for an Azure SQL Database. The database should be configured to automatically pause after 60 minutes of inactivity and resume with a minimum capacity of 0.5 vCores. However, the database is not pausing as expected. What is the most likely cause?

A.The 'zoneRedundant' property is set to false, which prevents auto-pause.
B.The database is not configured with the 'Serverless' compute tier.
C.The 'autoPauseDelay' value is too low; it must be at least 360 minutes.
D.The API version does not support auto-pause.
AnswerB

Auto-pausing after inactivity and resuming at a minimum 0.5 vCores are exclusive to the serverless compute tier. Provisioned and hyperscale tiers never auto-pause, so the database must be serverless for the configured behaviour to take effect.

Why this answer

Auto-pause functionality is only available for Azure SQL Database in the serverless compute tier. Without configuring the database as serverless (by setting the 'sku' property to include 'Serverless' tier), the auto-pause and auto-resume features will not work, regardless of other property settings. Option A is incorrect because the 'zoneRedundant' property does not affect auto-pause.

Option C is incorrect because the minimum 'autoPauseDelay' for serverless is 60 minutes, not 360. Option D is incorrect because the API version used supports serverless features.

14
MCQmedium

You need to automate the scaling of an Azure SQL Database in response to CPU usage using Azure Automation. Which Azure service should you use to monitor CPU metrics and trigger the runbook?

A.Azure SQL Analytics
B.Azure Log Analytics
C.Kusto Query Language (KQL)
D.Azure Monitor metric alerts
AnswerD

Azure Monitor metric alerts evaluate platform metrics such as CPU percentage on a near-real-time basis and fire an action group that invokes the Azure Automation runbook via a webhook. This satisfies the stem's requirement to monitor CPU usage and trigger scaling automatically, unlike log-based alerts which add query latency.

Why this answer

Azure Monitor metric alerts are used to monitor CPU metrics and trigger actions such as runbooks in Azure Automation. You can create an alert rule based on a metric like CPU percentage, and configure an action group that triggers a runbook. This is the standard way to automate scaling based on metrics.

Exam trap

DP-300 often tests the confusion between Azure Monitor metric alerts and Log Analytics, where candidates may think Log Analytics triggers runbooks, but metric alerts are the correct service for metric-based automation.

How to eliminate wrong answers

Option A is wrong because Azure SQL Analytics is a monitoring solution that provides insights but does not directly trigger runbooks; it is deprecated and replaced by Azure Monitor. Option B is wrong because Azure Log Analytics is used for querying and analyzing log data, not for metric-based alerting and triggering runbooks directly. Option C is wrong because Kusto Query Language (KQL) is a query language used in Log Analytics, not a service that triggers runbooks.

15
MCQmedium

You have an Azure SQL Database that stores sensitive customer data. You need to automate the masking of a specific column for non-admin users. Which feature should you use?

A.Always Encrypted with a column encryption key.
B.Row-Level Security to filter rows for non-admin users.
C.Dynamic Data Masking with a masking function configured on the column.
D.Azure Policy to enforce masking rules on the database.
AnswerC

Dynamic Data Masking applies a masking function to the column so non-admin users see obfuscated values at query time, while privileged users retain full data. This satisfies the requirement to automate masking for non-admin users without altering stored data or application code.

Why this answer

Dynamic Data Masking (DDM) is the correct feature because it masks sensitive data in query results for non-privileged users without altering the actual data at rest. You configure a masking rule (e.g., default(), email(), partial()) on the specific column, and users without UNMASK permission see masked values while admins see the real data. This matches the requirement to 'automate masking of a specific column for non-admin users.'

Exam trap

DP-300 often tests the confusion between Dynamic Data Masking (presentation-layer masking for non-admins) and Always Encrypted (cryptographic protection where even admins can't see plaintext) — candidates pick Always Encrypted when the scenario asks for masked views.

How to eliminate wrong answers

Option A is wrong because Always Encrypted encrypts data at rest and in transit, making it unreadable even to DBAs, but it requires client-side key management and does not provide a 'masked view for non-admins while admins see plaintext' behavior — it's an encryption feature, not a masking feature. Option B is wrong because Row-Level Security filters which rows a user can see, not which columns are masked; it does not alter column values. Option D is wrong because Azure Policy is a governance/compliance tool that audits or enforces resource configurations at the control plane, not a database-level data masking mechanism.

16
MCQmedium

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?

A.Configure a SQL Server Agent job on an Azure virtual machine that connects to the database.
B.Deploy an Azure Automation runbook that connects to the database and executes the script.
C.Use Azure Logic Apps with a recurrence trigger and a SQL Server connector to run the script.
D.Create an Elastic Job agent and define a job step that runs the T-SQL script on a schedule.
AnswerD

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.

Why this answer

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.

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.

17
MCQhard

Your Azure SQL Database uses a failover group for disaster recovery. You need to automate a planned failover for disaster recovery testing without data loss. What should you use?

A.Set up an Azure Logic App with a failover trigger from Azure Monitor.
B.Configure automatic failover policy in the failover group.
C.Use a T-SQL script with ALTER DATABASE FAILOVER scheduled via SQL Server Agent.
D.Create an Azure Automation Runbook that uses the Start-AzSqlDatabaseFailover command with the -AllowDataLoss parameter set to false.
AnswerD

Runbook can automate planned failover without data loss.

Why this answer

Azure Automation Runbooks can execute the Start-AzSqlDatabaseFailover cmdlet with -AllowDataLoss:$false to perform a planned failover without data loss. Option A (Logic App with failover trigger) is designed for reacting to Azure Monitor alerts, not for scheduled failsafe testing. Option B (configuring automatic failover policy) is for unplanned failovers and would result in data loss if used for testing because automatic failover is asynchronous.

Option C (T-SQL ALTER DATABASE FAILOVER scheduled via SQL Server Agent) is invalid because SQL Server Agent is not available in Azure SQL Database (single database or elastic pool); it's only available in Azure SQL Managed Instance. Therefore, D is the correct choice for automated planned failover.

18
MCQhard

A DBA manages an Azure SQL Database and needs to schedule a T-SQL script to run every day at 02:00 UTC to perform index maintenance. The solution must minimize administrative overhead and must not require an on-premises server. What should the DBA use?

A.Elastic Database Jobs in Azure SQL Database
B.SQL Server Agent job on the Azure SQL Database logical server
C.Azure Automation runbook with a schedule and the Az.Sql module
D.Azure Logic Apps with a recurrence trigger and SQL Server connector
AnswerA

Elastic Database Jobs are a native Azure SQL Database feature that can run T-SQL scripts against one or many databases on a schedule. They require no on-premises infrastructure and minimal setup: create a job agent, a job, a step, and a schedule. This directly satisfies the requirement to run a T-SQL script daily with low overhead.

Why this answer

Elastic Database Jobs provide a built-in scheduling mechanism for T-SQL scripts against Azure SQL Database. The DBA creates a job agent, defines a job with a T-SQL step, and attaches a schedule. This requires no on-premises server and minimal administrative effort, making it the correct choice for daily index maintenance.

Exam trap

The trap here is assuming that SQL Server Agent is available on Azure SQL Database, when Agent is only supported on Azure SQL Managed Instance and on-premises SQL Server.

19
MCQhard

Your company uses Azure SQL Managed Instance. You need to automate the execution of a stored procedure that processes sales data every night at 2 AM. The solution must use native capabilities and minimize latency. What should you do?

A.Create an Elastic Database Job to run the stored procedure on the target database.
B.Use Azure Logic Apps with a recurrence trigger to call the stored procedure via a connector.
C.Create a SQL Agent job with a schedule to execute the stored procedure.
D.Deploy an Azure Function with a timer trigger to invoke the stored procedure via the SQL binding.
AnswerC

SQL Agent is built into Azure SQL Managed Instance and runs T-SQL jobs on a schedule, so a nightly job at 2 AM executes the stored procedure natively with no external orchestrator or added latency.

Why this answer

SQL Agent is a native component of Azure SQL Managed Instance and supports scheduled job execution with T-SQL steps, making it the correct choice for running a stored procedure nightly at 2 AM. It minimizes latency because the job runs directly on the instance without external orchestration or network hops.

Exam trap

The trap is assuming that because Elastic Jobs and Azure Functions are newer, they are always preferred; the exam tests recognition that SQL Agent is native and lowest-latency for MI.

How to eliminate wrong answers

Option A is wrong because Elastic Database Jobs are designed for Azure SQL Database, not Managed Instance, and add unnecessary complexity. Option B is wrong because Logic Apps introduce external latency and require a connector, which contradicts the requirement to minimize latency and use native capabilities. Option D is wrong because Azure Functions with SQL bindings are external compute and not native to the instance, adding latency and management overhead.

20
MCQmedium

You need to automate the execution of a T-SQL script against all user databases in an Azure SQL Database elastic pool. The script should run on a schedule and results should be logged to a table. Which feature should you use?

A.SQL Agent jobs
B.Azure Data Factory
C.Azure Automation with PowerShell runbooks
D.Elastic Database Jobs
AnswerD

Elastic Database Jobs run T-SQL across every database in a pool from a job agent, using a target group rather than per-database connections. This satisfies the scheduled, pool-wide execution requirement, and job step output can be written to a logging table.

Why this answer

Elastic Database Jobs are designed for executing T-SQL across many databases in a pool. SQL Agent is not available in Azure SQL Database. Azure Automation runbooks can run T-SQL but require more setup.

Azure Data Factory is for data movement, not T-SQL execution.

21
Multi-Selecthard

You need to automate the deployment of Azure SQL Database with a specific configuration across multiple environments (dev, test, prod). The deployment must include firewall rules, auditing settings, and threat detection policies. Which THREE tools can be used to implement this automation?

Select 3 answers
A.ARM templates with Bicep
B.Azure Migrate
C.Azure PowerShell
D.Azure Data Studio
E.Azure CLI
AnswersA, C, E

Bicep is a declarative DSL that transpiles to ARM templates, letting you define the database, firewall rules, auditing, and threat detection policies once and redeploy identically across dev, test, and prod. Parameter files handle per-environment differences.

Why this answer

ARM templates with Bicep (A) are correct because Bicep is a declarative IaC language that transpiles to ARM JSON, allowing you to define Azure SQL Database resources, firewall rules, auditing settings, and threat detection policies as code and deploy them idempotently across dev, test, and prod. Azure PowerShell (C) is correct because cmdlets such as New-AzSqlServerFirewallRule, Set-AzSqlServerAudit, and Set-AzSqlDatabaseThreatDetectionPolicy let you script the full deployment and configuration of Azure SQL Database programmatically. Azure CLI (E) is correct because commands like az sql server firewall-rule create, az sql server audit-policy update, and az sql db threat-policy update provide cross-platform scripting for the same automation.

Azure Migrate (B) is not correct because it is a discovery, assessment, and migration service for on-premises workloads, not a deployment automation tool. Azure Data Studio (D) is not correct because it is an interactive query and management client, not an automation or infrastructure-as-code tool for repeatable multi-environment deployments.

Exam trap

The trap is selecting tools that are database management or migration focused (Azure Data Studio, Azure Migrate) instead of infrastructure automation tools; candidates must recognize that automation of deployment requires IaC or CLI/PowerShell, not client query tools.

22
MCQmedium

You are implementing automated table partitioning maintenance for a large Azure SQL Database. The partitioning function uses a monthly range. You need to add a new partition for the next month and remove the oldest partition. What is the best way to automate this?

A.Create a stored procedure that uses SELECT INTO to copy old data to a history table and then TRUNCATE the partition.
B.Use ALTER INDEX REORGANIZE to compress old partitions.
C.Schedule a T-SQL script via Elastic Database Jobs that uses ALTER PARTITION FUNCTION to SPLIT the range and MERGE the oldest boundary.
D.Use the SWITCH PARTITION operation to move the oldest partition to a staging table and then drop the staging table.
AnswerC

ALTER PARTITION FUNCTION ... SPLIT adds the next month's boundary, while MERGE collapses the oldest one, keeping the monthly range current. Elastic Database Jobs run this T-SQL on a schedule without external compute, satisfying the automation requirement for Azure SQL Database, where SQL Agent is unavailable.

Why this answer

The correct approach is to schedule a T-SQL script via Elastic Database Jobs that uses ALTER PARTITION FUNCTION ... SPLIT to add a new boundary for the next month and MERGE to remove the oldest boundary. This automates partition maintenance without moving data or dropping tables, and Elastic Database Jobs provide cross-database scheduling native to Azure SQL Database.

Exam trap

DP-300 often tests the difference between SWITCH (moves data between a partition and a table) and SPLIT/MERGE (changes partition boundaries); candidates may choose SWITCH alone, forgetting that it does not update the partition function.

How to eliminate wrong answers

Option A is wrong because SELECT INTO copies data and TRUNCATE removes all rows from a partition, which is inefficient and does not maintain the partition function boundaries; it also loses partition metadata. Option B is wrong because ALTER INDEX REORGANIZE only defragments indexes and does not add or remove partitions. Option D is wrong because SWITCH PARTITION moves a partition to a staging table, but it does not update the partition function boundaries; without SPLIT/MERGE the function still expects the old range, and dropping the staging table does not remove the boundary.

23
MCQmedium

A DBA manages an Azure SQL Managed Instance and needs to automate a weekly full backup of a user database to an Azure Storage account. The solution must use native SQL Server functionality and minimize custom code. What should the DBA do?

A.Use Azure Data Factory with a copy activity to export the database to a storage account weekly.
B.Create an Azure Automation runbook that runs a PowerShell script using the Invoke-Sqlcmd cmdlet to perform a backup.
C.Create a SQL Server Agent job with a T-SQL step that executes BACKUP DATABASE TO URL.
D.Configure automated backups in the Azure portal to write to a custom storage account.
AnswerC

Azure SQL Managed Instance supports native BACKUP DATABASE TO URL, which writes backups directly to Azure Blob Storage. SQL Server Agent is available on Managed Instance, so scheduling a job with a T-SQL step is a native, low-code solution. This meets the requirement without external orchestration.

Why this answer

Azure SQL Managed Instance supports SQL Server Agent and native BACKUP DATABASE TO URL. Creating an Agent job with a T-SQL step that executes the backup to Azure Blob Storage provides a native, scheduled solution with minimal custom code. This is the most straightforward way to automate weekly full backups to a storage account.

Exam trap

The trap here is assuming that Azure SQL Managed Instance automated backups can be configured to write to a user-specified storage account, when they are actually service-managed and not customizable.

24
Multi-Selectmedium

You are a database administrator for a retail company that uses Azure SQL Database. You need to automate the process of detecting and responding to high CPU usage. You want to create an alert that triggers an action when CPU usage exceeds 80% for 10 minutes. Which two components must you configure? (Choose two.)

Select 2 answers
A.An action group that defines the notification and action types.
B.A diagnostic setting that streams resource logs to a Log Analytics workspace.
C.An alert rule in Azure Monitor with a metric signal for CPU percentage.
D.An Elastic Job that runs a T-SQL script to scale the database when the alert fires.
E.A Log Analytics workspace to store the CPU metrics for analysis.
AnswersA, C

An action group specifies what happens when an alert fires, such as sending an email, SMS, or triggering a runbook. To respond to high CPU usage, you must associate an action group with the alert rule. Without an action group, the alert would only be visible in the Azure portal but would not perform any automated response.

Why this answer

To automate detection and response to high CPU usage, you need an alert rule that monitors the CPU percentage metric and an action group that defines the response. The alert rule evaluates the condition and fires when the threshold is exceeded. The action group then executes the specified actions, such as sending notifications or triggering automation.

Diagnostic settings and Log Analytics are not required for metric alerts, and Elastic Jobs are not triggered by alerts.

Exam trap

The trap here is confusing metric alerts with log alerts; metric alerts do not require diagnostic settings or a Log Analytics workspace.

25
MCQeasy

Refer to the exhibit. An administrator runs this Azure CLI command. What is the immediate effect?

A.The server's performance tier is changed to S2.
B.The OrdersDB database's service objective is updated to S2.
C.The database is scaled down from a higher tier to S2.
D.A new database named OrdersDB is created with S2 tier.
AnswerB

The command alters the database's service objective, moving it to the S2 performance level within its existing elastic pool or standalone tier. This immediately changes the compute and DTU allocation applied to OrdersDB, taking effect without recreating the database.

Why this answer

The Azure CLI command 'az sql db update' with '--service-objective S2' modifies the service tier of an existing database. The immediate effect is that the OrdersDB database's service objective is changed to S2, which alters its performance level and cost. It does not create a new database or change the server tier.

Exam trap

The trap is confusing 'server' with 'database' in Azure SQL — candidates often assume the command affects the logical server, but Azure SQL Database service objectives apply per database, not per server.

How to eliminate wrong answers

Option A is wrong because the command targets a database, not the logical SQL server — server performance tiers are not a concept in Azure SQL Database (servers are just logical containers). Option C is wrong because the command does not specify a previous tier; it simply sets the target service objective to S2, regardless of whether the database was previously higher or lower. Option D is wrong because 'az sql db update' modifies an existing database — creating a new database requires 'az sql db create'.

26
MCQhard

You administer an Azure SQL Managed Instance that hosts a mission-critical database. You need to configure an automated task that will execute a T-SQL script to perform a full backup of the database to a URL every night at midnight. The solution must use built-in Azure capabilities and minimize cost. What should you use?

A.Azure Automation runbook with a schedule
B.Azure Logic Apps with a recurrence trigger
C.Elastic Database Jobs
D.SQL Server Agent job on the managed instance
AnswerD

Azure SQL Managed Instance includes SQL Server Agent, which is fully supported. You can create a job with a T-SQL step that runs BACKUP DATABASE TO URL, and schedule it to run daily at midnight. This uses the built-in capabilities of the managed instance and does not require additional Azure services, minimizing cost and administrative effort.

Why this answer

Azure SQL Managed Instance includes SQL Server Agent, which allows you to create and schedule T-SQL jobs. For a nightly full backup to URL, a SQL Server Agent job with a T-SQL step is the most straightforward and cost-effective solution, leveraging existing functionality without extra services.

Exam trap

The trap here is overlooking that SQL Server Agent is available on Azure SQL Managed Instance, unlike Azure SQL Database.

27
Multi-Selecthard

You are a database administrator for a financial services company that uses Azure SQL Database. You need to automate the deployment of schema changes across multiple databases in a development environment. The solution must support version control, allow rollback to a previous state, and minimize manual intervention. Which two actions should you perform? (Choose two.)

Select 2 answers
A.Store the database schema as a SQL project in an Azure Repos Git repository and configure a build pipeline to generate a DACPAC artifact.
B.Configure Azure Automation runbooks to execute ALTER statements against each database on a schedule.
C.Use Azure DevOps Pipelines with a DACPAC deployment task to apply schema changes from a SQL project.
D.Implement Elastic Jobs to run T-SQL scripts that apply schema changes to each database.
E.Use SQL Server Data Tools (SSDT) to manually publish schema changes to each database from a developer workstation.
AnswersA, C

Storing the schema as a SQL project in Azure Repos Git provides version control. A build pipeline that generates a DACPAC artifact ensures that the schema is packaged for deployment. This, combined with a release pipeline, enables automated deployment and rollback to any previous version, fulfilling the requirements.

Why this answer

A CI/CD pipeline using Azure DevOps with a SQL project in Git and DACPAC deployment provides version control, automated deployment, and rollback capabilities. The combination of storing the schema in a Git repository and using a DACPAC deployment task ensures that schema changes are tracked, tested, and can be rolled back to a previous state with minimal manual effort.

Exam trap

The trap here is focusing on tools that can execute T-SQL but overlooking the need for version control and rollback, which are best addressed by a CI/CD pipeline with DACPAC.

28
Multi-Selectmedium

You are configuring automated backups for an Azure SQL Database. Which TWO settings can you configure?

Select 2 answers
A.Backup compression.
B.Backup frequency (full, differential, log).
C.Point-in-time restore interval.
D.Backup retention period (in days).
E.Geo-redundant storage (GRS) for backups.
AnswersD, E

Configurable from 7 to 35 days.

Why this answer

The backup retention period (in days) is a configurable setting for Azure SQL Database automated backups. You can set the retention period for point-in-time restore (PITR) backups between 1 and 35 days, and for long-term retention (LTR) backups up to 10 years. This directly controls how far back you can restore your database.

Exam trap

The trap here is that candidates confuse the configurable retention period with the non-configurable backup frequency or point-in-time restore interval, assuming they can adjust the schedule of full/differential/log backups or directly set the restore window, when in fact Azure SQL Database manages these automatically based on the retention policy.

29
MCQmedium

You are a database administrator for a logistics company that uses Azure SQL Database. The company requires that a stored procedure, which archives old shipment records, runs every night at 2:00 AM UTC. You need to configure a solution that minimizes administrative overhead and uses built-in Azure SQL Database capabilities. What should you do?

A.Use Azure Automation with a runbook that connects to the database and executes the stored procedure.
B.Configure a SQL Server Agent job on the logical server that hosts the database.
C.Create a SQL Server Integration Services (SSIS) package and schedule it with Azure Data Factory.
D.Create an elastic job agent and define a recurring job with a T-SQL step that executes the stored procedure.
AnswerD

Elastic jobs are a native Azure SQL Database feature designed to automate T-SQL execution across one or many databases on a schedule. By creating an elastic job agent and a job with a T-SQL step, you can run the stored procedure nightly without external orchestration. This minimizes administrative overhead because the scheduling and execution are fully managed by the service, and it directly meets the requirement.

Why this answer

Elastic jobs are the native scheduling mechanism in Azure SQL Database for running T-SQL on a recurring basis. They eliminate the need for external services or additional infrastructure, directly satisfying the requirement to minimize administrative overhead. The other options either rely on features not available in Azure SQL Database or introduce unnecessary complexity.

Exam trap

The trap here is assuming that SQL Server Agent is available in Azure SQL Database because it is a familiar scheduling tool in SQL Server.

30
Multi-Selectmedium

You are configuring an Azure Automation runbook to perform daily maintenance tasks on an Azure SQL Database. The runbook will run on a schedule and must securely connect to the database. Which two actions should you perform to enable the runbook to authenticate to the database? (Choose two.)

Select 2 answers
A.Store the SQL admin credentials in Azure Key Vault and retrieve them in the runbook
B.Configure the runbook to use a service principal with a client secret stored in an Automation variable
C.Enable a managed identity for the Automation account
D.Assign the Automation account the Contributor role on the Azure SQL Server
E.Create a contained database user in the target database for the managed identity
AnswersC, E

Enabling a managed identity for the Automation account creates an identity in Azure AD that the runbook can use to authenticate to Azure SQL Database without storing credentials. This is a secure, recommended practice. The identity must then be granted access to the database. This action is essential for the runbook to obtain a token and connect.

Why this answer

To enable an Azure Automation runbook to authenticate to Azure SQL Database securely without storing credentials, you should enable a managed identity for the Automation account and create a contained database user for that identity in the target database. These two actions allow the runbook to obtain an Azure AD token and connect. Other options either involve secret management or grant insufficient permissions.

Exam trap

The trap here is confusing management-plane roles with data-plane permissions; the Contributor role does not grant the ability to run T-SQL, and using Key Vault or service principals introduces unnecessary secret management.

31
MCQeasy

A company runs Azure SQL Database and wants to automatically receive an email alert when the database's CPU usage exceeds 90% for 10 minutes. The DBA needs to configure this with minimal effort. What should the DBA do?

A.Use Azure Automation to run a runbook every 10 minutes that checks CPU usage and sends an email.
B.Create an Azure Monitor alert rule on the cpu_percent metric with a threshold of 90 and an action group that sends email.
C.Configure a SQL Server Agent alert on the CPU usage performance condition.
D.Create a Database Mail profile and a SQL Agent operator to send the alert.
AnswerB

Azure Monitor alert rules can evaluate platform metrics like cpu_percent for Azure SQL Database. Setting a threshold of 90 and an action group with email notification directly fulfills the requirement. This is the native, low-effort solution for metric-based alerts on Azure SQL Database.

Why this answer

Azure Monitor alert rules are the native way to monitor platform metrics for Azure SQL Database. By creating a rule on the cpu_percent metric with a threshold and an action group that includes email, the DBA can automatically receive notifications when CPU exceeds 90% for the specified duration. This requires minimal configuration effort.

Exam trap

The trap here is confusing Azure SQL Database with Azure SQL Managed Instance, leading to the assumption that SQL Server Agent alerts and Database Mail are available on Azure SQL Database.

32
Multi-Selecthard

You need to automate monitoring and alerting for an Azure SQL Database. Which THREE actions can you achieve using Azure Monitor and SQL Insights?

Select 3 answers
A.Automatically rebuild fragmented indexes.
B.Automatically scale the database to a higher service tier.
C.Stream diagnostic logs to a Log Analytics workspace.
D.Set up an alert when DTU consumption exceeds 80% for 5 minutes.
E.Create a custom metric alert based on a KQL query.
AnswersC, D, E

Diagnostic settings allow log streaming.

Why this answer

Azure Monitor and SQL Insights allow you to configure diagnostic settings to stream SQL Database metrics and resource logs (e.g., query store runtime statistics, wait statistics) to a Log Analytics workspace. This enables centralized log analysis, custom KQL queries, and long-term retention for auditing and troubleshooting.

Exam trap

The trap here is that candidates confuse monitoring and alerting capabilities (Azure Monitor/SQL Insights) with automated remediation actions (like index rebuilds or auto-scaling), which are separate Azure services or manual tasks.

33
MCQhard

You are automating index maintenance for an Azure SQL Database using an Azure Automation runbook. The runbook connects to the database and executes T-SQL to rebuild fragmented indexes. You need to ensure the runbook can authenticate without storing credentials in the script. What should you configure?

A.A service principal with a client secret stored in the Automation account certificates
B.A managed identity for the Automation account with a contained database user in the target database
C.A SQL login with a strong password stored in an Automation variable
D.Azure Key Vault to store the SQL admin credentials, retrieved by the runbook at runtime
AnswerB

A managed identity for the Automation account allows the runbook to authenticate to Azure SQL Database without embedding credentials. You create a contained database user mapped to the managed identity and grant necessary permissions. This approach eliminates secret management and is the recommended secure method for Azure services to access databases. The runbook can use the identity to obtain a token and connect using Azure AD authentication.

Why this answer

The most secure and streamlined method for an Azure Automation runbook to authenticate to Azure SQL Database without storing credentials is to use a managed identity. The Automation account's managed identity is registered in Azure AD, and you create a contained database user in the target database for that identity. The runbook then connects using Azure AD authentication, eliminating secrets.

This is the recommended practice for automation.

Exam trap

The trap here is believing that storing credentials in Azure Key Vault or Automation variables fully satisfies the requirement, but those still involve managing secrets, whereas a managed identity eliminates them.

34
Drag & Dropmedium

Drag and drop the steps to configure an Azure SQL Database elastic pool in the correct order.

Drag or tap steps into the slots.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

First create the pool, then add databases, configure per-database limits, monitor, and scale.

35
Multi-Selectmedium

Which THREE components are required to set up elastic jobs in Azure SQL Database?

Select 3 answers
A.Azure Automation account
B.SQL Server Agent
C.Target groups
D.An elastic job agent
E.Job credentials
AnswersC, D, E

Target groups define the servers and databases that elastic jobs execute against, satisfying the requirement to specify which Azure SQL Database targets the job runs on. Without a target group, the job agent has no scope for execution, so this component is mandatory alongside the job agent and job credentials.

Why this answer

Target groups (C) are required because they define the set of databases (or elastic pools) against which an elastic job will execute. Without target groups, the job agent has no scope of execution. The elastic job agent (D) orchestrates job scheduling and execution, and job credentials (E) are needed to authenticate to the target databases for running T-SQL scripts.

Exam trap

The trap here is that candidates confuse SQL Server Agent (an on-premises/IaaS tool) with the cloud-native elastic job agent, or assume an Azure Automation account is needed for scheduling, when in fact elastic jobs have their own built-in scheduling and agent service.

36
MCQmedium

You are responsible for automating index maintenance in Azure SQL Database. You need to ensure that index rebuilds and reorganizations are performed only when fragmentation exceeds 30% and 10%, respectively, and that the job runs weekly. Which approach should you use?

A.Create a SQL Agent job using T-SQL script with sys.dm_db_index_physical_stats.
B.Use Elastic Database Jobs to run a script that rebuilds/reorganizes indexes.
C.Schedule a maintenance task using SQL Server Agent in a VM running SQL Server.
D.Enable automatic index tuning in Azure SQL Database with the desired fragmentation thresholds.
AnswerB

Elastic Database Jobs run T-SQL against Azure SQL Database on a schedule, letting a script evaluate sys.dm_db_index_physical_stats and rebuild above 30% or reorganise above 10% fragmentation weekly. No SQL Agent exists in Azure SQL Database.

Why this answer

Elastic Database Jobs are the native Azure SQL Database mechanism for scheduling and executing T-SQL across one or more databases without requiring a separate VM or SQL Server Agent. The job can run a custom T-SQL script that queries sys.dm_db_index_physical_stats to evaluate fragmentation and conditionally issue ALTER INDEX ... REBUILD or REORGANIZE based on the 30% and 10% thresholds.

This satisfies both the automation and the weekly schedule requirements within the PaaS environment.

Exam trap

DP-300 often tests the misconception that SQL Server Agent is available in Azure SQL Database, or that automatic tuning can be customized with specific fragmentation thresholds; candidates must remember that Elastic Database Jobs are the correct PaaS-native scheduling solution.

How to eliminate wrong answers

Option A is wrong because SQL Agent is not available in Azure SQL Database (PaaS); it only exists in SQL Server on-premises or on Azure VMs. Option C is wrong because it introduces an IaaS VM with SQL Server Agent, which is unnecessary overhead and not the intended solution for Azure SQL Database. Option D is wrong because automatic index tuning in Azure SQL Database does not let you configure custom fragmentation thresholds for rebuild/reorganize actions; it uses its own internal logic and does not expose those knobs.

37
MCQmedium

A company uses Azure SQL Database and wants to automatically send an email notification when an index fragmentation exceeds 30% for any database. Which solution should they implement?

A.Create an Azure Monitor alert based on fragmentation
B.Use Elastic Database Jobs to check fragmentation and send email
C.Configure SQL Agent job to send email
D.Use Azure Automation runbook to query sys.dm_db_index_physical_stats and send email
AnswerD

An Azure Automation runbook can query sys.dm_db_index_physical_stats on a schedule, evaluate fragmentation against the 30% threshold, and dispatch email via Office 365 or SendGrid. Azure SQL Database lacks native alerting on DMV output, so automation is required.

Why this answer

Azure SQL Database does not expose SQL Server Agent, and index fragmentation is not a native Azure Monitor metric, so the correct approach is an Azure Automation runbook that connects to the database, queries sys.dm_db_index_physical_stats, evaluates fragmentation, and sends email via SendGrid, Office 365, or SMTP. This is the standard pattern for custom T-SQL-based monitoring and alerting in Azure SQL Database.

Exam trap

DP-300 often tests whether candidates know that SQL Agent is unavailable in Azure SQL Database (but available in Managed Instance) — the trap is picking the SQL Agent job option because it is the familiar on-premises pattern.

How to eliminate wrong answers

Option A is wrong because Azure Monitor does not expose index fragmentation as a built-in metric — you cannot create an alert directly on fragmentation without first emitting a custom metric. Option B is wrong because Elastic Database Jobs are designed for cross-database administrative tasks (schema changes, index maintenance) but do not natively send email notifications based on query results — you would still need an external mechanism for the email. Option C is wrong because SQL Agent is not available in Azure SQL Database (it is available in Azure SQL Managed Instance and SQL Server on VMs), so you cannot create a SQL Agent job to send email.

38
MCQhard

Refer to the exhibit. A PowerShell script is used to move an Azure SQL Database into an elastic pool. The script runs without error. Which condition must be true before the script runs?

A.The elastic pool must be in a different server
B.The database must be in the same server as the elastic pool
C.The database must be in the Basic tier
D.The database size must be less than 10 GB
AnswerB

Elastic pools group databases sharing resources within a single logical server, so a database must already reside on that same server before being added. Moving a database across servers requires a separate operation, such as export/import or geo-restore, which the script does not perform. This satisfies the same-server constraint.

Why this answer

Moving a database into an elastic pool requires the database to be in the same server as the pool. Option A is wrong because the elastic pool must be in the same server as the database, not a different server. Option C is wrong because the database can be any service tier (Basic, Standard, Premium, etc.) as long as it fits within the pool's resource limits.

Option D is wrong because the database size can be any size up to the pool's max size limit, which is not necessarily less than 10 GB.

39
Multi-Selectmedium

You need to automate the deployment of schema changes to an Azure SQL Database using Azure DevOps. Which THREE components are required? (Choose three.)

Select 3 answers
A.Build pipeline
B.Release pipeline
C.Elastic job agent
D.Azure Automation runbook
E.Variable group
AnswersA, B, E

A build pipeline compiles and packages the database project into a DACPAC artefact, which the release stage later deploys. It is a required component because it produces the deployable schema artefact consumed by subsequent pipeline stages.

Why this answer

Option A (Build pipeline) is correct because a build pipeline is needed to compile the database project (e.g., a SQL Server Database Project / DACPAC) and produce the deployment artifact that will be published to the Azure SQL Database. Option B (Release pipeline) is correct because the release pipeline consumes that artifact and executes the deployment task (such as Azure SQL Database deployment or SqlPackage) against the target Azure SQL Database. Option E (Variable group) is correct because it stores reusable, environment-specific values (server name, database name, credentials, connection strings) that the pipelines reference, keeping secrets and configuration out of the pipeline definition.

Option C (Elastic job agent) is not required because it is used to run T-SQL jobs across a set of databases in a pool, not to deploy schema changes through Azure DevOps. Option D (Azure Automation runbook) is not required because runbooks automate operational tasks in Azure, but schema deployment in this scenario is handled by the Azure DevOps build and release pipelines.

Exam trap

DP-300 often tests the confusion between Azure DevOps pipeline components and other Azure services like Elastic Job Agent or Automation runbooks, which are not part of the CI/CD pipeline itself.

40
MCQmedium

You need to automate the creation of a new Azure SQL Database whenever a new customer signs up. The solution should use infrastructure as code and integrate with your CI/CD pipeline. What should you use?

A.Create an Azure Automation runbook that calls New-AzureRmSqlDatabase and trigger it from your CI/CD pipeline.
B.Create an ARM template that defines the database and deploy it from your CI/CD pipeline.
C.Set up an Elastic Database Job that runs a CREATE DATABASE statement.
D.Configure a SQL Server Agent job on the logical server to run a CREATE DATABASE statement.
AnswerB

An ARM template declares the Azure SQL Database resource in JSON, so the CI/CD pipeline can deploy it repeatably per customer signup. This satisfies the infrastructure-as-code requirement, unlike portal or manual scripting approaches that lack declarative version control.

Why this answer

B is correct because ARM (Azure Resource Manager) templates are the recommended infrastructure-as-code approach for defining and deploying Azure SQL Databases in a repeatable, declarative manner. Integrating ARM template deployment into a CI/CD pipeline ensures consistent, version-controlled database creation as part of automated workflows, aligning with DevOps best practices.

Exam trap

The trap here is that candidates may confuse operational automation (e.g., runbooks, SQL Agent jobs) with infrastructure-as-code provisioning, mistakenly choosing a scripting or T-SQL approach instead of the declarative ARM template method that natively integrates with CI/CD pipelines.

How to eliminate wrong answers

Option A is wrong because Azure Automation runbooks using the deprecated New-AzureRmSqlDatabase cmdlet (AzureRM module) are not infrastructure as code; they rely on imperative scripting, lack declarative state management, and the AzureRM module is being replaced by Az PowerShell, making this approach outdated and less reliable for CI/CD integration. Option C is wrong because Elastic Database Jobs are designed for executing T-SQL scripts across multiple databases (e.g., schema maintenance, data updates), not for provisioning new databases; they cannot create a new database as part of a CI/CD pipeline. Option D is wrong because SQL Server Agent jobs run within the context of a single logical server and are not designed for infrastructure-as-code automation; they lack integration with CI/CD pipelines, version control, and declarative deployment, and are intended for administrative tasks like maintenance, not provisioning new databases from external triggers.

41
MCQeasy

You need to automate the deployment of an Azure SQL Database along with its firewall rules and performance tier using infrastructure as code. Which technology should you use?

A.Bicep templates
B.SQL Server Data Tools (SSDT) database projects
C.T-SQL scripts
D.PowerShell scripts
AnswerA

Bicep is a declarative infrastructure-as-code language that defines the Azure SQL Database, its firewall rules and performance tier in a single template, then deploys them repeatably. This satisfies the requirement to automate deployment of all three resources together.

Why this answer

Bicep is a domain-specific language for deploying Azure resources declaratively. It is the recommended infrastructure as code tool for Azure. Option A is correct because Bicep templates allow you to define Azure SQL Database, firewall rules, and performance tier in a declarative manner.

Option B (SSDT) is used for database schema management, not resource deployment. Option C (T-SQL scripts) are for database queries and management, not infrastructure. Option D (PowerShell scripts) can automate tasks but are procedural, not declarative IaC like Bicep.

42
MCQhard

You manage an Azure SQL Managed Instance that hosts several databases. You need to automate the process of patching the operating system and SQL Server engine with minimal downtime. What should you use?

A.Configure the maintenance window for the Managed Instance.
B.Use an Elastic Job agent to run a script that applies updates.
C.Schedule a manual patching using the Azure portal.
D.Use Azure Update Manager to schedule patching.
AnswerA

Azure SQL Managed Instance handles OS and SQL engine patching automatically; the maintenance window merely schedules when that built-in patching occurs, letting you align it to low-traffic periods. Since the stem requires automation with minimal downtime, configuring the window satisfies both constraints without manual intervention or additional tooling.

Why this answer

Azure SQL Managed Instance provides a built-in maintenance window feature that allows you to schedule patching of the underlying OS and SQL Server engine with minimal downtime. Configuring the maintenance window ensures updates are applied during a specified time, reducing impact on production workloads.

Exam trap

DP-300 often tests the difference between automated patching features of Azure SQL Managed Instance and other Azure services, and candidates may incorrectly choose Azure Update Manager or manual methods.

How to eliminate wrong answers

Option B is wrong because Elastic Job agent is used for automating and running T-SQL scripts across databases, not for patching the managed instance. Option C is wrong because manual patching via the Azure portal is not automated and does not provide minimal downtime; patching is managed by Azure. Option D is wrong because Azure Update Manager is for managing updates on VMs and servers, not for Azure SQL Managed Instance, which has its own patching mechanism.

43
MCQmedium

You need to automate the deployment of an Azure SQL Database and its schema updates as part of a CI/CD pipeline. The pipeline must apply T-SQL scripts to the database after deployment. Which Azure DevOps task should you use to execute the T-SQL scripts against Azure SQL Database?

A.Azure PowerShell task
B.Azure SQL Database deployment task
C.Command line task
D.Azure CLI task
AnswerB

The Azure SQL Database deployment task in Azure Pipelines is designed to execute T-SQL scripts against an Azure SQL Database. It supports inline scripts or script files and handles authentication. This task is the native way to apply schema updates in a CI/CD pipeline for Azure SQL Database.

Why this answer

The Azure SQL Database deployment task is built for executing T-SQL scripts against Azure SQL Database in a pipeline. It supports both inline scripts and script files, and it handles authentication via service connections. This makes it the most efficient and reliable choice for applying schema changes in CI/CD.

Exam trap

The trap here is choosing a generic task like Azure PowerShell or Command Line, which can work but require custom code, instead of the purpose-built SQL deployment task.

44
Multi-Selectmedium

You need to automate the monitoring of Azure SQL Database performance and receive alerts when certain conditions are met. Which TWO Azure services can be used together to achieve this?

Select 2 answers
A.Azure Sentinel
B.Log Analytics Workspace
C.Azure Monitor Alerts
D.Application Insights
E.Azure Advisor
AnswersB, C

Log Analytics stores and queries the diagnostic and metric data collected from Azure SQL Database. It supplies the log store that alert rules evaluate, satisfying the requirement for a queryable repository underpinning automated performance monitoring and alerting.

Why this answer

Log Analytics Workspace (B) is correct because it is the service that stores and queries the diagnostic and metric telemetry collected from Azure SQL Database, enabling you to write Kusto Query Language (KQL) queries that define the performance conditions to monitor. Azure Monitor Alerts (C) is correct because it evaluates those log/metric queries against defined thresholds and triggers notifications (for example, email, SMS, or action groups) when the conditions are met. Together, Log Analytics Workspace provides the data and query layer while Azure Monitor Alerts provides the rule evaluation and notification layer, forming the standard automated monitoring and alerting pipeline for Azure SQL Database.

Azure Sentinel (A) is a SIEM/SOAR tool focused on security threat detection, not general SQL performance monitoring. Application Insights (D) targets application-level telemetry (APM) for web apps and services, not Azure SQL Database performance metrics. Azure Advisor (E) only provides best-practice recommendations and does not perform real-time condition-based alerting.

45
MCQeasy

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?

A.SQL Server Agent
B.Elastic Database Jobs
C.Azure Automation Runbook
D.Azure Logic Apps
AnswerB

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.

Why this answer

Elastic Database Jobs (B) is the correct service for automating T-SQL script execution across Azure SQL Database on a recurring schedule. It is specifically designed for Azure SQL Database and Azure SQL Managed Instance, providing a job scheduler that can run T-SQL scripts against multiple databases, handle retries, and manage job history. SQL Server Agent is not available in Azure SQL Database (only in SQL Server on-premises or Azure SQL Managed Instance), making Elastic Database Jobs the appropriate choice for this PaaS scenario.

Exam trap

The trap here is that candidates confuse SQL Server Agent (available in Azure SQL Managed Instance) with Azure SQL Database (single database/elastic pool), mistakenly assuming Agent is available for all Azure SQL offerings, when in fact Elastic Database Jobs is the correct scheduler for the PaaS Azure SQL Database service.

How to eliminate wrong answers

Option A is wrong because SQL Server Agent is not available in Azure SQL Database (single database or elastic pool); it is only supported in SQL Server on-premises, Azure SQL Managed Instance, and SQL Server on Azure VMs. Option C is wrong because Azure Automation Runbooks are designed for PowerShell or Python workflows, not for direct T-SQL execution against Azure SQL Database; they would require additional modules and connection management, making them less suitable for simple recurring T-SQL scripts. Option D is wrong because Azure Logic Apps are orchestration services for integrating apps and data, not a native T-SQL scheduler; they can execute SQL queries via connectors but lack the built-in job scheduling, retry policies, and database-targeting features of Elastic Database Jobs.

46
MCQeasy

Your organization uses Azure SQL Database and needs to automate email notifications when a database reaches 80% storage usage. Which native Azure feature can you use?

A.Create an Azure Monitor alert rule on the 'storage_percent' metric with an email action group.
B.Create a SQL Agent alert that fires when the storage is above 80% and sends an email.
C.Configure Database Mail to send alerts automatically.
D.Create an Elastic Database Job that checks storage and sends email via sp_send_dbmail.
AnswerA

Azure Monitor alert rules evaluate platform metrics such as storage_percent and trigger action groups, which deliver email notifications. This satisfies the requirement for native, automated alerting at the 80% threshold without custom code or external tooling, unlike query-based or scheduled approaches.

Why this answer

Azure Monitor alert rules on the 'storage_percent' metric with an email action group are the native Azure feature for this requirement. Azure SQL Database emits the storage_percent metric to Azure Monitor, and alert rules can trigger when it exceeds 80%, invoking an action group that sends email. This is fully managed, requires no SQL Agent, and works for both single databases and elastic pools.

Exam trap

DP-300 often tests the misconception that SQL Server features like SQL Agent, Database Mail, and sp_send_dbmail are available in Azure SQL Database, when in fact they are only supported in Azure SQL Managed Instance or on-premises SQL Server.

How to eliminate wrong answers

Option B is wrong because SQL Agent is not available in Azure SQL Database (it is available in Azure SQL Managed Instance and SQL Server on-premises), so SQL Agent alerts cannot be created on Azure SQL Database. Option C is wrong because Database Mail is a SQL Server feature that is not supported in Azure SQL Database, and it is used for sending mail from T-SQL, not for metric-based alerting. Option D is wrong because Elastic Database Jobs run T-SQL on a schedule and could theoretically query storage, but they are not a native alerting mechanism and would require custom scripting plus an external mail relay, which Azure SQL Database does not provide via sp_send_dbmail.

47
MCQmedium

You are a database administrator for a logistics company that uses Azure SQL Database. You need to automate the process of copying data from an on-premises SQL Server to Azure SQL Database every night. The data volume is large, and you want to minimize the impact on the source server. You also need to ensure that the copy operation is resilient to transient failures. What should you use?

A.Azure Elastic Jobs with a T-SQL script that uses OPENROWSET to read from the on-premises server.
B.Azure Data Factory with a self-hosted integration runtime and a copy activity.
C.Azure Automation runbook that uses the Invoke-Sqlcmd cmdlet to copy data.
D.SQL Server Integration Services (SSIS) with an Azure-SSIS integration runtime.
AnswerB

Azure Data Factory with a self-hosted integration runtime can connect to on-premises SQL Server and Azure SQL Database. The copy activity can be scheduled and supports parallel reads to minimize source impact. It also has built-in retry policies to handle transient failures, making it resilient. This is the recommended approach for large-scale data movement.

Why this answer

Azure Data Factory with a self-hosted integration runtime is the best solution. It can connect to on-premises SQL Server, perform parallel data extraction to reduce source impact, and has built-in retry and resilience features. It is designed for scheduled, large-scale data movement.

The other options either lack the necessary connectivity, are not optimized for performance, or do not provide the required resilience.

Exam trap

The trap here is assuming that Elastic Jobs can directly query on-premises sources, but they run in Azure and require additional connectivity.

48
MCQeasy

You need to automate the deployment of an Azure SQL Database using Infrastructure as Code. The deployment should include the database, firewall rules, and threat detection settings. Which tool should you use?

A.Azure CLI scripts
B.Azure Automation runbooks
C.Azure Policy
D.Azure Resource Manager templates
AnswerD

ARM templates declaratively define the Azure SQL Database, firewall rules, and threat detection settings in one deployment, satisfying the Infrastructure as Code requirement. They natively support all three resource types without custom scripting or extra tooling.

Why this answer

Azure Resource Manager (ARM) templates are the native IaC for Azure. Azure Automation runbooks can deploy but are not declarative. Azure CLI can script deployments but is imperative.

Azure Policy is for governance, not deployment.

49
MCQeasy

You are designing an automated backup retention policy for an Azure SQL Database. The business requirement is to retain daily backups for 30 days, weekly backups for 12 weeks, monthly backups for 12 months, and yearly backups for 7 years. Which backup retention type should you configure?

A.Point-in-time restore (PITR) retention
B.Backup vault with Azure Backup
C.Long-term retention (LTR) policy
D.Automated backup policy
AnswerC

Long-term retention extends Azure SQL Database backups beyond the default 7–35 day point-in-time window, storing full backups in RA-GRS blob storage on separate daily, weekly, monthly and yearly schedules. This directly satisfies the stem's 7-year yearly retention requirement, which the built-in short-term policy cannot provide.

Why this answer

Long-term retention (LTR) policy in Azure SQL Database is specifically designed to retain full backups beyond the default PITR window, supporting configurable weekly, monthly, and yearly retention periods. The requirement of 30 days daily, 12 weeks weekly, 12 months monthly, and 7 years yearly maps exactly to LTR's weekly/monthly/yearly retention options, which can be set independently.

Exam trap

DP-300 often tests the confusion between PITR (short-term, up to 35 days) and LTR (long-term, up to 10 years), tempting candidates to pick PITR or Azure Backup when multi-year tiered retention is required.

How to eliminate wrong answers

Option A is wrong because PITR retention only covers 1-35 days of point-in-time restore capability and does not support weekly, monthly, or yearly retention schedules. Option B is wrong because Azure Backup with a Backup vault is used for Azure VMs, file shares, and other workloads — not for Azure SQL Database automated backups, which use the built-in LTR feature. Option D is wrong because the 'automated backup policy' is the default PITR-based backup mechanism and does not provide the multi-year, tiered retention required.

50
MCQeasy

You need to automate the deployment of schema changes to multiple Azure SQL Databases in different regions. The solution must support rollback and version control. Which technology should you use?

A.Use Azure Data Factory to run stored procedures for schema changes.
B.Use SQL Server Agent jobs to run deployment scripts on schedule.
C.Use Azure DevOps with a database project and release pipelines.
D.Use Azure Automation with PowerShell scripts to execute T-SQL scripts.
AnswerC

Azure DevOps database projects keep schema definitions in version control, and release pipelines deploy them across regions with tracked, repeatable steps. This satisfies both the rollback requirement, via redeploying prior versions, and version control of schema changes.

Why this answer

Azure DevOps with a database project and release pipelines is the correct choice because it provides source control for schema changes, automated deployment across multiple environments, and built-in rollback capabilities through pipeline versioning and deployment history. This approach aligns with infrastructure-as-code principles, enabling consistent, repeatable, and auditable schema deployments to Azure SQL Databases in different regions.

Exam trap

The trap here is that candidates often confuse Azure Data Factory or Azure Automation as valid automation tools for schema changes, overlooking that they lack the version control and rollback capabilities that are explicitly required by the question.

How to eliminate wrong answers

Option A is wrong because Azure Data Factory is an ETL and data orchestration service, not a schema deployment tool; it lacks native version control for schema changes and cannot perform rollback of DDL operations. Option B is wrong because SQL Server Agent jobs run on a single SQL Server instance and cannot be centrally managed for multi-region Azure SQL Databases; they also lack version control and rollback support. Option D is wrong because Azure Automation with PowerShell scripts executes ad-hoc or scheduled scripts but does not provide integrated version control, release pipeline gating, or automated rollback mechanisms for schema changes across multiple databases.

51
MCQeasy

You need to automatically send an email notification when an Azure SQL Database reaches 80% storage usage. What should you configure?

A.Azure Monitor alert with action group
B.Change Data Capture (CDC) with Logic Apps
C.Elastic Database Job with sp_send_dbmail
D.SQL Agent Mail
AnswerA

An Azure Monitor alert evaluates the database's storage metric against an 80% threshold and triggers an action group, which delivers the email notification. This satisfies the requirement for automatic notification without custom scripting or manual monitoring.

Why this answer

Azure Monitor alerts with action groups are the native mechanism for triggering notifications based on platform metrics such as storage percentage on an Azure SQL Database. You create an alert rule on the 'storage' metric with a threshold of 80%, and attach an action group that sends email (or SMS, webhook, etc.). This is the standard, supported approach for metric-based notifications on Azure SQL Database.

Exam trap

DP-300 often tests the misconception that SQL Server features like SQL Agent Mail or sp_send_dbmail are available in Azure SQL Database, when in fact PaaS Azure SQL Database does not support SQL Agent or Database Mail.

How to eliminate wrong answers

Option B is wrong because Change Data Capture tracks row-level data changes for replication/ETL purposes and has nothing to do with storage-usage monitoring or alerting. Option C is wrong because Elastic Database Jobs run T-SQL across databases and sp_send_dbmail requires Database Mail configured on a SQL Server instance — Azure SQL Database does not support SQL Agent or Database Mail. Option D is wrong because SQL Agent Mail is a SQL Server on-premises/IaaS feature; Azure SQL Database (PaaS) does not expose SQL Agent, so this is not available.

52
MCQmedium

You have an Azure SQL Database that stores sensitive data. You need to automatically classify and apply sensitivity labels to new columns as they are added. What should you use?

A.Microsoft Purview Information Protection
B.Azure Policy with custom policy definition
C.Dynamic Data Masking
D.Azure Automation with PowerShell script to run sp_addsensitivityclassification
AnswerA

Purview can automatically scan and classify sensitive data.

Why this answer

Microsoft Purview Information Protection enables automatic classification and labeling of sensitive data in Azure SQL Database through its data classification capabilities. It can be configured to automatically detect and apply sensitivity labels to new columns based on built-in or custom rules. Option B (Azure Policy) can enforce compliance but does not perform automatic classification of data within the database.

Option C (Dynamic Data Masking) obscures sensitive data but does not classify or label it. Option D (Azure Automation with PowerShell) requires custom scripting and does not provide built-in automatic classification integration for new columns.

53
MCQmedium

You have an Azure SQL Database that needs to be backed up daily using Azure Automation runbooks. The runbook must trigger an export of the database to a storage account. How should you configure the runbook to authenticate securely to Azure?

A.Use a shared access signature (SAS) token stored in the runbook
B.Use Automation Account credential assets
C.Enable a system-assigned managed identity for the Automation account
D.Store the SQL admin credentials as variables in the runbook
AnswerC

Managed identities provide secure authentication without storing credentials.

Why this answer

Managed Identity (system-assigned or user-assigned) is the recommended secure authentication method for Azure Automation runbooks, avoiding stored credentials. Option A uses credentials stored in the runbook, which is less secure. Option B uses automation account credentials, which still requires key management.

Option D is not a valid type.

54
MCQeasy

You need to automatically notify the operations team when an Azure SQL Database reaches 80% storage usage. Which Azure service should you use to create the alert?

A.Azure Automation
B.Microsoft Sentinel
C.Azure Logic Apps
D.Azure Monitor
AnswerD

Azure Monitor hosts metric alerts that evaluate platform metrics such as storage space used against a threshold, triggering action groups to notify the operations team. It satisfies the automatic notification requirement without custom code, unlike Query Store or Elastic Jobs.

Why this answer

Azure Monitor is the native monitoring and alerting service in Azure. It can collect metrics from Azure SQL Database, including storage usage, and trigger alerts based on thresholds like 80%. You can create an alert rule that sends notifications via email, SMS, or webhook to the operations team.

Exam trap

DP-300 often tests the distinction between monitoring/alerting (Azure Monitor) and automation/workflow (Logic Apps, Automation), so candidates may incorrectly choose a service that can send notifications but is not designed for metric-based alerting.

How to eliminate wrong answers

Option A is wrong because Azure Automation is for process automation and configuration management, not for monitoring and alerting on metrics. Option B is wrong because Microsoft Sentinel is a SIEM/SOAR solution for security analytics, not for operational metric alerts. Option C is wrong because Azure Logic Apps is for workflow automation and integration, not for generating alerts based on resource metrics; it could be used as an action in an alert, but not as the alerting service itself.

55
Multi-Selecthard

Which THREE of the following are required to automate schema deployments to Azure SQL Database using Azure DevOps? (Select exactly three.)

Select 3 answers
A.A release pipeline with a 'Azure SQL Database deployment' task.
B.A SQL database project (.sqlproj) containing the schema.
C.A service connection to Azure with appropriate permissions.
D.A schema compare tool to generate deployment scripts.
E.A self-hosted build agent with SQL tools installed.
AnswersA, B, C

The Azure SQL Database deployment task in a release pipeline executes the DACPAC or SQL script against the target database, providing the actual deployment mechanism. Without this task, the pipeline has no way to apply schema changes to Azure SQL Database.

Why this answer

Option A is correct because the 'Azure SQL Database deployment' task in an Azure DevOps release pipeline is the built-in mechanism that executes the DACPAC/BACPAC against the target Azure SQL Database, making it essential for automation. Option B is correct because a SQL database project (.sqlproj) declaratively defines the schema and is compiled into a DACPAC, which is the artifact the deployment task consumes to apply schema changes. Option C is correct because the pipeline needs an Azure service connection (ARM service connection) with sufficient permissions to authenticate and deploy to the Azure SQL Database.

Option D is not required because the Azure SQL Database deployment task uses SqlPackage/DACPAC deployment natively and does not depend on a separate schema compare tool. Option E is not required because Microsoft-hosted agents already include the necessary SQL tooling, so a self-hosted agent with SQL tools is optional rather than mandatory.

Exam trap

DP-300 often tests the minimum components for CI/CD database deployment; candidates may incorrectly assume a schema compare tool or self-hosted agent is required, when the built-in task and hosted agents suffice.

56
MCQmedium

You are configuring automated backup retention for Azure SQL Managed Instance. The compliance policy requires that you be able to restore a database to any point within the last 90 days, and that you keep backups for a minimum of 7 years for auditing purposes. Which backup retention policy should you configure?

A.Set PITR retention to 35 days and configure a long-term retention (LTR) policy to keep weekly backups for 7 years.
B.Set point-in-time restore (PITR) retention to 90 days.
C.Set PITR retention to 90 days and configure geo-replication to achieve the 7-year retention.
D.Configure geo-redundant backup storage with a retention of 90 days.
AnswerA

PITR covers 35 days; LTR can retain backups for up to 10 years, satisfying the 7-year requirement.

Why this answer

Azure SQL Managed Instance's point-in-time restore (PITR) retention is capped at 35 days, so to meet the 90-day restore requirement, you must combine a 35-day PITR policy with a long-term retention (LTR) policy that keeps weekly full backups for 7 years. LTR allows you to restore to any point within the LTR window by using full, differential, and log backups, satisfying both the 90-day point-in-time restore and the 7-year auditing compliance.

Exam trap

The trap here is that candidates assume PITR retention can be extended to any value, but Azure SQL Managed Instance enforces a hard 35-day maximum, forcing you to combine PITR with LTR to meet longer retention requirements.

How to eliminate wrong answers

Option B is wrong because PITR retention in Azure SQL Managed Instance has a maximum of 35 days, not 90 days, so it cannot meet the 90-day restore requirement. Option C is wrong because PITR retention cannot be set to 90 days (max 35), and geo-replication does not provide backup retention; it provides disaster recovery but does not extend backup retention to 7 years. Option D is wrong because geo-redundant backup storage (RA-GRS) only affects storage redundancy, not retention duration; it still cannot exceed the 35-day PITR limit and does not address the 7-year auditing requirement.

57
MCQhard

You are reviewing a PowerShell script that is part of an Azure Automation runbook. The script is intended to monitor resource usage of an Azure SQL Database and trigger an alert if DTU usage exceeds 80%. The script runs successfully but does not trigger the alert. What is the most likely reason?

A.The script must use the -OutputAs parameter to return results.
B.The script uses Out-GridView, which is not supported in Azure Automation.
C.The Invoke-SqlCmd cmdlet is not compatible with Azure SQL Database.
D.The query syntax is incorrect for Azure SQL Database.
AnswerB

Out-GridView requires an interactive desktop session to render its graphical window, and Azure Automation runbooks execute headlessly in a sandbox with no GUI. The cmdlet therefore fails silently or blocks, so the DTU threshold comparison never completes and no alert fires, satisfying the stem's non-interactive constraint.

Why this answer

In Azure Automation runbooks, there is no interactive desktop environment, so cmdlets that require a graphical user interface, such as Out-GridView, are not supported. When the script runs in a runbook, Out-GridView fails silently or does not produce any output, causing the subsequent alert logic (which likely depends on the output) to never trigger. Option A is incorrect because the -OutputAs parameter is used with Invoke-SqlCmd to specify the output format, not to return results for alerting.

Option C is incorrect because Invoke-SqlCmd is fully compatible with Azure SQL Database when proper authentication is used. Option D is incorrect because the script runs successfully, indicating the query syntax is valid.

58
MCQhard

Refer to the exhibit. You are deploying an Azure SQL Database using this ARM template. After deployment, you need to automate the scaling of the database to a higher service tier when DTU consumption exceeds 80% for 5 minutes. Which Azure service should you use to trigger the scaling?

A.Azure SQL Analytics
B.Azure Automation Update Management
C.SQL Server Agent
D.Azure Monitor metric alert
AnswerD

Azure Monitor metric alerts evaluate the database's DTU percentage against an 80% threshold sustained over a five-minute window, then fire an action group. That action group can invoke automation to scale the service tier, giving the required metric-driven trigger.

Why this answer

Azure Monitor metric alerts can be configured to trigger an Azure Automation runbook that scales the Azure SQL Database when DTU consumption exceeds 80% for 5 minutes. This is a common pattern for autoscaling based on metrics. Option A (Azure SQL Analytics) is a monitoring solution that does not trigger actions.

Option B (Azure Automation Update Management) is for managing updates on virtual machines, not for scaling databases. Option C (SQL Server Agent) is not available in Azure SQL Database; it is used for on-premises SQL Server instances.

59
Multi-Selecthard

You are the database administrator for a logistics company that uses Azure SQL Database. A nightly Azure Automation runbook must trigger a stored procedure in the database after each successful run. The runbook authenticates to Azure using a system-assigned managed identity for the Automation account. You need to grant the managed identity the least-privilege permissions required to execute the stored procedure. Which two actions should you perform? (Choose two.)

Select 2 answers
A.Store the database administrator password in an Automation variable and use SQL authentication in the runbook.
B.Create a database user for the managed identity and add it to the db_owner fixed database role.
C.Assign the managed identity the Contributor role on the Azure SQL logical server resource.
D.Run GRANT EXECUTE ON OBJECT::dbo.usp_ProcessShipments TO [automation-account-name] in the target database.
E.Connect to the database as a Microsoft Entra administrator and run CREATE USER [automation-account-name] FROM EXTERNAL PROVIDER.
AnswersD, E

After the contained database user exists for the managed identity, the minimal data-plane permission needed to run the stored procedure is EXECUTE on that specific object. This grants exactly the required capability without broader rights, satisfying least privilege for the Automation runbook scenario described.

Why this answer

Managed identities for Azure Automation require a contained database user mapped via FROM EXTERNAL PROVIDER before permissions can be granted. Once that user exists, the least-privilege permission for running a single stored procedure is EXECUTE on that object. Together these two actions let the runbook invoke the procedure without over-provisioning rights or introducing stored credentials.

Exam trap

The trap here is assuming an Azure RBAC role such as Contributor on the logical server grants T-SQL execution rights, when management-plane roles never provide data-plane permissions.

60
Multi-Selecthard

Which TWO methods can be used to automate index maintenance in Azure SQL Database?

Select 2 answers
A.Azure Automation runbooks executing T-SQL scripts
B.SQL Server Agent jobs
C.Azure Data Factory pipelines
D.Elastic jobs with T-SQL steps
E.Automatic tuning
AnswersA, D

Runbooks can connect to Azure SQL Database and run maintenance scripts.

Why this answer

Azure Automation runbooks can execute T-SQL scripts against Azure SQL Database using the Invoke-SqlCmd cmdlet or similar, enabling scheduled index maintenance tasks such as rebuilding or reorganizing indexes. This method is fully supported in Azure SQL Database, which lacks SQL Server Agent, and allows for flexible, cloud-native automation.

Exam trap

The trap here is that candidates often assume SQL Server Agent (Option B) is available in Azure SQL Database, but it is only supported in Azure SQL Managed Instance, not the single database or elastic pool service tiers.

61
Multi-Selectmedium

You are a database administrator for a manufacturing company that uses Azure SQL Database. The company wants to automate the deployment of database schema changes across multiple databases in an elastic pool. You need to implement a solution that tracks which scripts have been applied and ensures they are applied only once per database. Which two actions should you perform? (Choose two.)

Select 2 answers
A.Define a target group in the elastic job that includes all databases in the elastic pool.
B.Create an elastic job with a T-SQL step that checks a version table in each database before applying the script.
C.Use Azure Automation runbooks to deploy the scripts to each database individually.
D.Configure the elastic job to run on a schedule that executes every minute to ensure quick deployment.
E.Use SQL Server Agent on the logical server to execute the scripts across all databases.
AnswersA, B

A target group defines the set of databases against which the job runs. By including all databases in the elastic pool, the job automatically applies the script to each database. This, combined with the version check, ensures the script is applied only once per database. Target groups can be dynamically populated based on server or pool membership, simplifying maintenance.

Why this answer

Elastic jobs with a target group that includes all databases in the pool, combined with a T-SQL step that checks a version table, provide a robust solution for one-time schema deployment. The target group ensures all databases are covered, and the version check ensures idempotency. This leverages native Azure SQL Database automation and avoids external orchestration.

Exam trap

The trap here is overlooking the need for idempotency; without a version table, the script would run every time the job executes, potentially causing errors or duplicate changes.

62
MCQeasy

You need to automate the deployment of database schema changes across multiple Azure SQL Databases in a development environment. Which Azure service is designed for this purpose?

A.Azure DevOps using database projects and release pipelines.
B.SQL Agent jobs on each database.
C.Azure Automation Account with PowerShell runbooks.
D.Azure Data Factory with a copy activity.
AnswerA

Azure DevOps database projects (DACPAC) with release pipelines provide version-controlled, repeatable schema deployment across multiple Azure SQL Databases. This satisfies the automation requirement, unlike ad hoc scripts or manual changes, by generating idempotent deployment plans per target.

Why this answer

Azure DevOps with database projects and release pipelines provides a CI/CD solution specifically designed for deploying schema changes to Azure SQL Databases. Option B is incorrect because SQL Agent jobs are used for scheduled administrative tasks within a single database, not for multi-database schema deployment automation. Option C is incorrect because Azure Automation Account with PowerShell runbooks is suitable for general automation tasks but lacks native CI/CD capabilities for database schema updates.

Option D is incorrect because Azure Data Factory with copy activity focuses on data movement and transformation, not on executing schema changes.

63
MCQeasy

You are a database administrator for a healthcare company that uses Azure SQL Database. The compliance team requires that all automated tasks that modify data must be logged with the identity that executed them. You need to configure an elastic job to run a T-SQL script that updates patient records. Which authentication method should you use for the job step to meet the auditing requirement?

A.Azure Active Directory authentication using a service principal with a client secret.
B.A database-scoped credential that stores a SQL login and password.
C.The job agent's managed identity with a contained database user in the target database.
D.SQL authentication using a server-level login stored in the job database.
AnswerC

Elastic jobs can authenticate to target databases using the job agent's managed identity. By creating a contained database user mapped to that managed identity and granting it the necessary permissions, all T-SQL steps run under that identity. This provides a clear, auditable identity for any data modifications, satisfying the compliance requirement. Managed identities are also more secure because they avoid storing passwords.

Why this answer

The job agent's managed identity provides a distinct, auditable identity for elastic job execution. By creating a contained database user for that identity, all actions performed by the job are attributed to it, which satisfies the compliance need. Managed identities also eliminate password management, making them the recommended approach for elastic jobs.

Exam trap

The trap here is confusing the authentication used by the job agent to connect to the job database with the authentication used to execute steps in target databases.

64
MCQmedium

You have an Azure SQL Database that must be automatically restarted every night to clear the procedure cache. You plan to use elastic jobs in Azure SQL Database. What should you create first?

A.A job database
B.An elastic job agent
C.A target group
D.A job credential
AnswerB

Elastic jobs require an elastic job agent as the parent Azure resource that stores job definitions, credentials and target databases. Without creating the agent first, you cannot define the nightly T-SQL job that clears the procedure cache, so it satisfies the prerequisite constraint in the stem.

Why this answer

To use elastic jobs in Azure SQL Database, you must first create an elastic job agent. The agent is the compute resource that runs the jobs. After creating the agent, you create a job database, target groups, credentials, and jobs.

The agent is the foundational component.

Exam trap

DP-300 often tests the order of elastic job components, and candidates may incorrectly select the job database or target group as the first step, overlooking the need for the agent.

How to eliminate wrong answers

Option A is wrong because the job database is created after the elastic job agent; it stores job definitions and execution history. Option C is wrong because target groups are created after the agent and define the databases to run jobs against. Option D is wrong because job credentials are created after the agent and are used to connect to target databases.

65
Multi-Selecthard

Which THREE components are required to run Elastic Database Jobs for Azure SQL Database? (Choose three.)

Select 3 answers
A.A job database
B.Target databases (members of the job group)
C.A job agent
D.SQL Agent
E.Azure Automation account
AnswersA, B, C

Elastic Database Jobs require a job database to store job definitions, execution history and step metadata. It holds the T-SQL scripts and schedules the job agent executes against target members, making it an essential component alongside the job agent and target group.

Why this answer

Elastic Database Jobs require a job database (A), which stores job definitions, execution history, and job step metadata, and it must reside in the same Azure SQL Database server as the job agent. They also require a job agent (C), the Azure resource that executes T-SQL against the target databases and is created in the job database's server. Target databases (B) are required because they are the members of the job group against which the job steps run.

SQL Agent (D) is not used, since Elastic Database Jobs are an Azure SQL Database-native feature rather than an on-premises SQL Server Agent component. Azure Automation account (E) is also unnecessary, as scheduling and execution are handled by the job agent and job database, not by Azure Automation.

66
Multi-Selecthard

A database administrator manages an Azure SQL Managed Instance that hosts a mission-critical database. The administrator needs to automate the execution of a T-SQL script that performs index maintenance and then sends an email notification with the results. The solution must use native Azure SQL Managed Instance capabilities and minimize external dependencies. Which two actions should the administrator perform? (Choose two.)

Select 2 answers
A.Configure a Logic App that triggers on a schedule and sends an email via Office 365.
B.Create an Elastic Database Job that targets the Managed Instance database.
C.Deploy an Azure Automation runbook that connects to the Managed Instance and runs the script.
D.Configure Database Mail on the Managed Instance and add a notification step to the job.
E.Create a SQL Server Agent job with a T-SQL step that runs the index maintenance script.
AnswersD, E

Database Mail is supported on Azure SQL Managed Instance and can be configured with an SMTP account. Adding a notification step to the SQL Server Agent job allows the job to send email results directly from the instance, meeting the notification requirement without external services.

Why this answer

SQL Server Agent and Database Mail are both supported natively on Azure SQL Managed Instance. Using a SQL Server Agent job with a T-SQL step and a notification step satisfies the automation and email requirements while keeping the solution self-contained on the instance.

Exam trap

The trap here is assuming that Azure SQL Managed Instance lacks SQL Server Agent and Database Mail, which are actually available.

67
Multi-Selecthard

Which TWO actions are required to automate the export of an Azure SQL Database to a BACPAC file on a monthly basis? (Choose two.)

Select 2 answers
A.Configure long-term retention (LTR) policy for the database.
B.Use Azure Automation or a scheduled Azure Function to call the Export-AzSqlDatabase cmdlet.
C.Deploy a SQL Server on Azure VM to run the export command.
D.Install SQL Server Integration Services (SSIS) on a virtual machine.
E.Create an Azure Storage account with a container to store the BACPAC file.
AnswersB, E

Export-AzSqlDatabase performs the actual BACPAC export, but it must run unattended. Azure Automation runbooks or a timer-triggered Azure Function supply that monthly schedule and authenticate to the subscription, satisfying the automation requirement the question specifies.

Why this answer

Option B is correct because automating a monthly BACPAC export requires a scheduling/orchestration mechanism, and Azure Automation runbooks or a timer-triggered Azure Function can invoke the Az PowerShell cmdlet Export-AzSqlDatabase (or the equivalent az sql db export CLI command) on a recurring schedule. Option E is correct because a BACPAC export must be written to a destination, and the Export-AzSqlDatabase cmdlet requires a target Azure Storage account and container (specified via -StorageAccountName/-StorageContainerName or a storage key/URI) to hold the resulting .bacpac file. Option A is not required because long-term retention (LTR) applies to automated full/differential/log backup copies for point-in-time restore, not to BACPAC logical exports.

Option C is not required because the export is a platform service performed by Azure SQL Database; no SQL Server on an Azure VM is needed. Option D is not required because SSIS is an ETL tool and plays no role in generating a BACPAC export.

Exam trap

DP-300 often tests the components required for automating BACPAC export, and candidates may incorrectly include LTR or SSIS, which are not relevant.

68
MCQeasy

You need to automate the creation of an Azure SQL Database and a corresponding server-level firewall rule to allow access from a specific IP address. The deployment must be repeatable and version-controlled. What should you use?

A.Create an ARM template that defines both the server firewall rule and the database.
B.Write a PowerShell script that uses New-AzSqlDatabase and New-AzSqlServerFirewallRule.
C.Use the Azure portal to create the database and firewall rule.
D.Use SQL Server Management Studio to script the creation.
AnswerA

ARM templates are declarative JSON files stored in source control, so the server-level firewall rule and database deploy together in one repeatable, version-controlled operation. This directly satisfies the repeatability and version-control constraints, unlike imperative scripts or portal-based creation.

Why this answer

ARM templates are declarative JSON files that define the desired state of Azure resources, including Azure SQL Database and server-level firewall rules. They support idempotent deployments, meaning the same template can be run repeatedly to ensure the environment matches the definition, and they can be version-controlled in source control. This makes them ideal for repeatable, automated deployments.

The template can include both the Microsoft.Sql/servers/firewallRules and Microsoft.Sql/servers/databases resources, ensuring they are created together.

Exam trap

DP-300 often tests the distinction between imperative scripting (like PowerShell) and declarative infrastructure-as-code (like ARM templates) for repeatable, version-controlled deployments, and candidates may incorrectly choose PowerShell because it is a common automation tool, overlooking the requirement for idempotency and version control.

How to eliminate wrong answers

Option B is wrong because while PowerShell scripts can automate deployment, they are imperative and not inherently idempotent or version-controlled; they require additional logic to handle repeatability and state, and they are not declarative templates. Option C is wrong because using the Azure portal is a manual, interactive process that is not repeatable or version-controlled, and it cannot be easily automated. Option D is wrong because SQL Server Management Studio (SSMS) is used for managing SQL Server instances and databases, but it does not provide infrastructure-as-code capabilities for Azure resource deployment, and scripting in SSMS would not automate the creation of Azure SQL Database and firewall rules in a repeatable, version-controlled manner.

69
MCQmedium

You are a database administrator for a logistics company that uses Azure SQL Database. The company requires an automated task to run every night at 02:00 UTC to archive old shipment records into a separate table. You need to minimize administrative overhead and ensure the task runs reliably even if there is a transient failure. What should you implement?

A.Create an Elastic Job agent, define a target group that includes the database, and create a job with a T-SQL step that performs the archival. Schedule the job to run daily at 02:00 UTC.
B.Use Azure Logic Apps to trigger an Azure Function that executes the archival T-SQL against the database on a daily schedule.
C.Configure a SQL Agent job on the Azure SQL Database to run the archival T-SQL daily at 02:00 UTC.
D.Create an Azure Automation runbook that connects to the database and executes the archival T-SQL, and schedule it with a daily trigger.
AnswerA

Elastic Jobs are designed to automate T-SQL tasks across one or many databases in Azure SQL Database. They natively support scheduling, retry on failure, and logging. By targeting the specific database and scheduling a daily job, you meet the requirement with minimal administrative overhead and built-in reliability for transient failures.

Why this answer

Elastic Jobs provide a native, low-overhead way to schedule and run T-SQL across Azure SQL databases. They include built-in retry logic and logging, which ensures the archival task runs reliably even with transient failures. Other options either are not supported on Azure SQL Database (SQL Agent) or require more administrative effort and custom error handling (Azure Automation, Logic Apps with Functions).

Exam trap

The trap here is assuming that SQL Agent is available in Azure SQL Database, when in fact it is only available in Azure SQL Managed Instance and SQL Server on Azure VMs.

70
MCQhard

You are responsible for automating backups of on-premises SQL Server databases to Azure Blob Storage. The solution must use the least administrative effort and provide point-in-time restore capability. What should you implement?

A.Configure SQL Server Managed Backup to Microsoft Azure.
B.Install Azure Backup Server on-premises and configure backup of SQL Server databases.
C.Use SQL Server Agent jobs to perform full, differential, and log backups to an Azure Blob Storage URL.
D.Use Azure Data Factory to copy database backups to Blob Storage.
AnswerA

SQL Server Managed Backup to Microsoft Azure automates full, differential and transaction log backups to Blob Storage with built-in scheduling and retention, requiring no custom scripts. It satisfies both constraints: least administrative effort and point-in-time restore through log chain continuity.

Why this answer

SQL Server Managed Backup to Microsoft Azure (also known as Managed Backup) is the correct choice because it provides automated, policy-based backup management with minimal administrative effort. It natively supports point-in-time restore by automatically scheduling full, differential, and transaction log backups to Azure Blob Storage, and it handles backup retention and recovery point management without requiring custom scripts or additional infrastructure.

Exam trap

The trap here is that candidates often confuse Azure Backup Server (a general-purpose backup tool) with SQL Server Managed Backup, or they assume that manually scripting backups with SQL Server Agent jobs is the simplest approach, overlooking the built-in automation and point-in-time restore capabilities of Managed Backup.

How to eliminate wrong answers

Option B is wrong because Azure Backup Server requires installing and maintaining an on-premises server, which increases administrative effort and does not provide native point-in-time restore for SQL Server without additional configuration. Option C is wrong because using SQL Server Agent jobs to manually script full, differential, and log backups to Azure Blob Storage requires significant administrative effort to create, schedule, and maintain the jobs, and it does not offer the automated retention and recovery point management that Managed Backup provides. Option D is wrong because Azure Data Factory is an ETL and data orchestration service, not a backup solution; it cannot perform SQL Server transaction log backups or provide point-in-time restore capabilities.

71
MCQhard

You manage an Azure SQL Database that is part of a failover group. You need to automate the failover to the secondary region in the event of a disaster. Which approach should you use?

A.Configure the auto-failover group to automatically fail over.
B.Schedule a failover using elastic jobs.
C.Create an Azure Automation runbook that initiates the failover.
D.Use a SQL Server Agent job to trigger failover.
AnswerA

Auto-failover groups replicate databases to a secondary region and trigger failover automatically when the primary becomes unavailable, without manual intervention. This satisfies the disaster-recovery automation requirement, since the group's policy initiates the regional switch based on outage detection rather than operator action.

Why this answer

Auto-failover groups are designed to automatically fail over to the secondary region in the event of a disaster, providing built-in automation. Option C is incorrect because while an Azure Automation runbook could be used to initiate a failover manually, it is redundant since the auto-failover group already handles automatic failover. Options B and D are incorrect because elastic jobs are for management tasks like data consistency, and SQL Server Agent is not available in Azure SQL Database.

72
MCQmedium

A company uses Azure SQL Database and wants to automate the process of refreshing a development database from production backups weekly. Which Azure service should be used to orchestrate this process including restore and post-restore scripts?

A.Elastic Database Jobs
B.Azure Logic Apps
C.Azure Automation with PowerShell runbooks
D.Azure Data Factory
AnswerC

Azure Automation runbooks execute scheduled PowerShell that can invoke Az.Sql cmdlets to restore the production backup and then run post-restore T-SQL scripts. This satisfies the orchestration requirement spanning restore plus subsequent scripting, which a plain backup policy alone cannot perform.

Why this answer

Azure Automation with PowerShell runbooks is designed for orchestrating scheduled administrative tasks across Azure resources, including database restore operations and post-restore T-SQL scripts. It supports credentials, schedules, and integration with Azure SQL via the SqlServer module, making it the right tool for weekly refresh automation.

Exam trap

DP-300 often tests the distinction between orchestration tools — candidates confuse Elastic Database Jobs (T-SQL only) with Azure Automation (external scripting), picking the former because it sounds database-specific.

How to eliminate wrong answers

Option A is wrong because Elastic Database Jobs are for running T-SQL across a set of databases, not for orchestrating restore operations or executing external scripts. Option B is wrong because Logic Apps are workflow automation tools better suited to event-driven integrations, not scheduled database restore orchestration with PowerShell. Option D is wrong because Azure Data Factory is a data integration service for ETL/ELT pipelines, not for database restore and post-restore scripting.

73
MCQmedium

You are a database administrator for a retail company that uses Azure SQL Database with the Serverless compute tier. The database experiences unpredictable idle periods, and you want to minimize costs by automatically pausing the database when it is idle for more than 60 minutes and resuming it when a connection is attempted. However, you also need to ensure that a critical reporting job that runs every hour can connect even if the database is paused. What should you do?

A.Enable the serverless auto-pause feature with a delay of 60 minutes. No additional action is needed; the reporting job will automatically resume the database upon connection.
B.Disable auto-pause for the database and use Azure Automation to scale down the database during idle periods.
C.Use Elastic Database Jobs to keep the database active by running a lightweight query every 59 minutes.
D.Set the auto-pause delay to 0 minutes to minimize costs, and create an Azure Automation runbook to keep the database active during the reporting job.
AnswerA

Azure SQL Database serverless auto-pause with a 60-minute delay suspends the database during idle periods, cutting compute cost. Any incoming connection, including the hourly reporting job, automatically triggers resume, so no extra configuration is required to keep the job working.

Why this answer

Azure SQL Database serverless auto-pause suspends the database after a configurable idle period (minimum 15 minutes, maximum 10,080 minutes) and automatically resumes it on the next connection attempt, with only a short resume latency billed at compute rates. Setting the auto-pause delay to 60 minutes meets the cost goal, and because the hourly reporting job's connection itself triggers the resume, no additional mechanism is required. This is the native, supported behavior of the serverless tier and requires no external orchestration.

Exam trap

DP-300 often tests the misconception that auto-pause requires an external keep-alive or that a paused database cannot be woken by an incoming connection — candidates over-engineer with Automation runbooks when the native resume-on-connect behavior already solves the problem.

How to eliminate wrong answers

Option B is wrong because disabling auto-pause eliminates the primary cost-saving mechanism of the serverless tier and replaces it with a manual scaling runbook that does not actually pause compute — it just changes vCore limits. Option C is wrong because running a keep-alive query every 59 minutes defeats the purpose of auto-pause entirely, keeping the database continuously active and incurring full compute charges. Option D is wrong because an auto-pause delay of 0 minutes is not a valid configuration (minimum is 15 minutes), and using an Automation runbook to keep the database active during the reporting job contradicts the goal of pausing when idle.

74
MCQhard

You have an Azure SQL Database that uses automatic tuning. You notice that a forced plan regression is causing performance degradation. You need to revert to the previous plan and prevent the automatic tuning from forcing the same plan again. What should you do?

A.Reindex the tables involved in the query.
B.Create a plan guide for the previous plan and then disable the automatic tuning recommendation for that query.
C.Disable automatic tuning for the database.
D.Run DBCC FREEPROCCACHE to clear the plan cache.
AnswerB

Creating a plan guide pins the previous execution plan, satisfying the requirement to revert the regressed query, while disabling the automatic tuning recommendation prevents the automatic tuning feature from re-forcing the same plan. Together these two actions address both the immediate regression and its recurrence.

Why this answer

When automatic tuning forces a plan that causes regression, the correct remediation is to create a plan guide that pins the previous (good) plan for that specific query, then disable the automatic tuning recommendation for that query so Azure SQL doesn't re-force the bad plan. This is a targeted fix that preserves automatic tuning for other queries.

Exam trap

DP-300 often tests whether candidates choose the nuclear option (disable automatic tuning entirely) when a targeted fix (plan guide + disable recommendation for that query) is the correct, least-disruptive solution.

How to eliminate wrong answers

Option A is wrong because reindexing does not address plan forcing — it may change statistics and plans unpredictably, but it does not revert or prevent the forced plan. Option C is wrong because disabling automatic tuning for the entire database is overly broad and loses the benefits of automatic tuning for all other queries; the question asks to prevent forcing the same plan again for this query, not to disable tuning globally. Option D is wrong because DBCC FREEPROCCACHE clears the entire plan cache, causing a temporary performance hit and not preventing automatic tuning from re-forcing the bad plan.

75
Multi-Selecteasy

Which TWO of the following are native options to automate index maintenance on Azure SQL Database? (Select exactly two.)

Select 2 answers
A.Create Elastic Database Jobs that run index maintenance T-SQL scripts.
B.Use Azure Automation PowerShell runbooks to invoke index rebuilds.
C.Enable automatic tuning with 'CREATE INDEX' and 'DROP INDEX' options.
D.Schedule SQL Agent jobs with ALTER INDEX statements.
E.Use Azure Data Factory to copy data and rebuild indexes.
AnswersA, C

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.

Why this answer

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.

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.

Page 1 of 2 · 83 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Configure and manage automation of tasks questions.