Courseiva

CCNA Configure and manage automation of tasks Questions

75 of 163 questions · Page 2/3 · Configure and manage automation of tasks · Answers revealed

76
MCQmedium

Your company uses Azure SQL Managed Instance and wants to automate the creation of new databases for each development sprint. Each database must be a copy of a template database with specific schema and data. You need to recommend an automation solution that minimizes manual steps and integrates with your CI/CD pipeline. What should you use?

A.Deploy an Azure Logic App with a SQL connector that triggers on a schedule.
B.Use the Azure portal's 'Create database from backup' feature.
C.Create an Elastic Database Job that runs CREATE DATABASE AS COPY OF...
D.Use an Azure DevOps pipeline with a PowerShell task that runs the 'az sql db copy' command or the Restore-AzSqlDatabase cmdlet.
AnswerC

Elastic Database Jobs (Elastic Jobs) support Managed Instance and can execute 'CREATE DATABASE AS COPY OF' on a schedule or trigger, allowing automation with CI/CD by invoking the job via REST API or Azure DevOps tasks.

Why this answer

For Azure SQL Managed Instance, automating database creation with CI/CD integration can be achieved using Elastic Database Jobs (now Elastic Jobs). These jobs can run T-SQL commands such as 'CREATE DATABASE AS COPY OF' to create copies of a template database. Elastic Jobs can be triggered programmatically via REST API or Azure DevOps tasks, enabling seamless integration into a CI/CD pipeline.

Option A (Logic App) does not support database copy operations. Option B (portal feature) requires manual steps. Option D uses PowerShell cmdlets ('az sql db copy' or 'Restore-AzSqlDatabase') that are specific to Azure SQL Database, not Managed Instance; the correct cmdlets for Managed Instance would be 'Restore-AzSqlInstanceDatabase' or T-SQL commands.

Therefore, option C is the most appropriate recommendation.

77
MCQeasy

You need to automate the backup of an Azure SQL Database to a storage account in a different region for disaster recovery. What should you configure?

A.Azure Backup for SQL Server in Azure VM
B.Configure geo-redundant backup storage
C.Configure long-term retention (LTR) in the same region
D.Elastic Database Job to export to BACPAC
AnswerB

Azure SQL Database offers geo-redundant storage by default.

Why this answer

Azure SQL Database automatically includes geo-redundant backup storage (RA-GRS) that replicates backups to a paired region for disaster recovery. Option A is incorrect because Azure Backup for SQL Server in Azure VM is for SQL Server installed on VMs, not for Azure SQL Database. Option C is incorrect because long-term retention (LTR) in the same region retains backups within the same region and does not provide cross-region disaster recovery.

Option D is incorrect because Elastic Database Jobs are for scheduling T-SQL scripts across multiple databases, not for automating backup to a different region.

78
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

ARM templates are the recommended way to provision Azure resources declaratively and can be deployed via Azure DevOps.

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.

79
MCQhard

You are a database administrator for a SaaS company that uses Azure SQL Database with elastic pools. The company has hundreds of databases (one per tenant). You need to automate the deployment of schema changes (e.g., adding new columns, creating indexes) across all tenant databases. The changes must be deployed in a rolling fashion to avoid affecting all tenants at once. The automation must track which databases have been updated and allow for rollback of individual tenant databases if needed. Additionally, the solution must integrate with Azure DevOps CI/CD pipelines. What should you do?

A.Use Azure Data Factory with a ForEach activity to execute stored procedures in each database.
B.Create an Azure Automation runbook that connects to each database sequentially and runs ALTER TABLE statements.
C.Configure SQL Agent jobs on each database to run the schema changes.
D.Develop an Azure SQL Database project in Visual Studio, generate a DACPAC, and use Elastic Database Jobs with a custom tracking table to apply the DACPAC to each tenant database in batches. Integrate with Azure DevOps to trigger the job after build.
AnswerD

Using a combination of Azure SQL Database project (DACPAC) for schema definition and Elastic Database Jobs for targeted deployment allows rolling updates per tenant. Azure DevOps can trigger the jobs.

Why this answer

Using a combination of Azure SQL Database project (DACPAC) for schema definition and Elastic Database Jobs for targeted deployment allows rolling updates per tenant. Azure DevOps can trigger the jobs. Option A is incorrect because Azure Data Factory is for data movement, not schema deployment.

Option B is incorrect because Azure Automation is not designed for multi-tenant schema deployment. Option C is incorrect because SQL Agent is not available in Azure SQL Database.

80
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 the native Azure IaC language for deploying Azure resources including SQL Database, firewall rules, and performance settings.

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.

81
MCQmedium

You are managing an Azure SQL Database that requires automated index maintenance. You want to use a solution that minimizes administrative overhead and leverages built-in Azure capabilities. Which approach should you recommend?

A.Enable automatic tuning for the database and configure the 'CREATE INDEX' and 'DROP INDEX' recommendations.
B.Deploy a third-party maintenance solution and connect it to the Azure SQL Database.
C.Create a custom PowerShell script and run it via Azure Automation Runbook on a schedule.
D.Schedule a SQL Agent job to rebuild indexes using a T-SQL script.
AnswerA

Automatic tuning handles index management automatically based on workload patterns.

Why this answer

Azure SQL Database's automatic tuning feature can automatically create and drop indexes based on workload patterns, minimizing administrative overhead and leveraging built-in Azure capabilities. Option B is incorrect because deploying a third-party solution would introduce additional complexity and cost, not leveraging built-in capabilities. Option C is incorrect because although Azure Automation can schedule scripts, it still requires custom scripting and maintenance, increasing overhead compared to fully automated built-in tuning.

Option D is incorrect because scheduling a SQL Agent job requires manual setup and is not a built-in automated feature of Azure SQL Database; SQL Agent is available only in managed instances, not in single databases or elastic pools, and requires custom T-SQL scripting.

82
MCQhard

Refer to the exhibit. You are configuring an Azure Automation schedule for a runbook that backs up Azure SQL Databases. The runbook should run daily at midnight. However, the runbook runs twice a day. What is the most likely cause?

A.The startTime is set to a past date
B.The schedule does not specify a time zone
C.Both interval and schedule.interval are defined, causing two triggers per day
D.The intervalUnit is set to Minutes instead of Days
AnswerC

Duplicate interval definitions cause the schedule to fire twice.

Why this answer

The configuration has both 'interval' (1440 minutes = 1 day) and 'schedule.interval' (P1D = 1 day), causing the runbook to trigger twice daily. Option A is wrong because time zone doesn't cause double firing. Option B is wrong because the start time is set.

Option D is wrong because the interval unit is minutes, not days.

83
MCQhard

Your company has a policy to automatically pause Azure SQL Databases during non-business hours to save costs. You need to implement this with minimal administrative overhead. What should you use?

A.Elastic Database Job that pauses the database
B.Serverless compute tier with auto-pause enabled
C.Azure Logic Apps with SQL connector to execute pause/resume
D.Azure Automation runbook with a schedule to pause/resume
AnswerB

Serverless automatically pauses during inactivity, meeting the requirement with no overhead.

Why this answer

The serverless compute tier can be configured to automatically pause the database after a period of inactivity, meeting the requirement with minimal overhead. Option A is incorrect because Elastic Database Jobs require creating a job to pause the database, adding overhead. Option C is incorrect because Azure Logic Apps with the SQL connector would require building a workflow, adding complexity.

Option D is incorrect because Azure Automation runbooks require scripting and maintenance, which is more overhead than the serverless auto-pause feature.

84
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

Managed Instance automatically applies updates during the configured maintenance window.

Why this answer

Azure SQL Managed Instance automatically applies OS and SQL Server engine updates during the user-configured maintenance window, minimizing downtime by performing patching during off-peak hours. Option B is wrong because Elastic Job agents are used for scheduling T-SQL jobs across multiple databases, not for patching the instance or OS. Option C is wrong because manual patching via the Azure portal is not an automated solution and would require manual effort and cause downtime.

Option D is wrong because Azure Update Manager is designed for Azure VMs and Arc-enabled servers, not for Azure SQL Managed Instance, which has its own built-in patching mechanism.

85
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

Stores and queries diagnostic logs from SQL Database.

Why this answer

Options B and C are correct because Azure Monitor Alerts (C) can be configured to monitor performance metrics of Azure SQL Database and trigger actions when thresholds are exceeded. Log Analytics Workspace (B) collects and analyzes the diagnostic logs and metrics, enabling deeper analysis and alert rules. Option A (Azure Sentinel) is a SIEM tool for security monitoring, not primarily for performance alerts.

Option D (Application Insights) is for application-level telemetry, not database-specific performance monitoring. Option E (Azure Advisor) provides recommendations but does not generate real-time alerts.

86
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 are specifically designed to run T-SQL scripts on a schedule across one or more Azure SQL databases.

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.

87
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 alerts are the standard way to send notifications based on metrics.

Why this answer

Azure Alert Rules can monitor metrics like storage percent and trigger email actions. Option B is wrong because SQL Agent is not available in Azure SQL Database. Option C is wrong because Elastic Jobs execute T-SQL, not send email directly.

Option D is wrong because Database Mail is not available in Azure SQL Database.

88
MCQmedium

You need to automate the creation of an Azure SQL Database using Azure CLI in a CI/CD pipeline. The database name must be unique and include the build ID. How should you specify the database name in the Azure CLI command?

A.Use the $RANDOM variable in Bash
B.Use the $(uuid) function in Azure CLI
C.Use a hardcoded name like 'mydb'
D.Use an environment variable $(Build.BuildId) set by the pipeline
AnswerD

Azure DevOps provides unique build IDs that can be referenced as environment variables.

Why this answer

In Azure DevOps pipelines, $(Build.BuildId) is a predefined variable that provides a unique build ID. This can be used in Azure CLI commands to create a unique database name, e.g., 'mydb-$(Build.BuildId)'. Option A ($RANDOM) is Bash-specific and not reliable across pipeline runs.

Option B (uuid) is not a valid Azure CLI function. Option C (hardcoded name) fails on pipeline rebuilds due to name conflicts.

89
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 define resources declaratively and can deploy database, firewall, and settings.

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.

90
MCQmedium

You are a database administrator for an Azure SQL Database. You need to automate the deployment of schema changes across multiple databases in an elastic pool. Which Azure service should you use to orchestrate these deployments?

A.Azure Functions
B.Azure Automation
C.Azure DevOps
D.Azure Logic Apps
AnswerC

Azure DevOps provides release pipelines for deploying schema changes across multiple databases.

Why this answer

Azure DevOps with its release pipelines can manage the deployment of schema changes across multiple databases. Option A is wrong because Azure Functions is for event-driven code, not orchestrated deployments. Option B is wrong because Azure Automation primarily manages infrastructure tasks, not database schema deployments.

Option D is wrong because Azure Logic Apps is for workflow integration, not database schema deployment.

91
MCQhard

Refer to the exhibit. An Azure SQL Database has the above ARM template for long-term retention (LTR) backup policy. Which statement is true about the retention duration?

A.Monthly backups are retained for 12 months.
B.Yearly backups are retained for 10 years.
C.Yearly backups are retained for 5 years.
D.Weekly backups are retained for 1 week.
AnswerC

YearlyRetention is P5Y, which equals 5 years.

Why this answer

In the ARM template for LTR backup policy, the yearlyRetention is set to P5Y, which means 5 years. WeeklyRetention is P2W (2 weeks), and monthlyRetention is P6M (6 months). Therefore, only option C is accurate.

Option A is incorrect because monthly backups are retained for 6 months, not 12. Option B is incorrect because yearly backups are retained for 5 years, not 10. Option D is incorrect because weekly backups are retained for 2 weeks, not 1 week.

92
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

LTR allows you to retain full backups for up to 10 years with configurable weekly, monthly, and yearly cycles.

Why this answer

Long-term retention (LTR) policy is specifically designed to retain backups beyond the point-in-time restore (PITR) window, supporting daily, weekly, monthly, and yearly retention periods. Option C is correct. Option A (PITR retention) is too short and cannot retain backups for years.

Option B (Backup vault with Azure Backup) is used for Azure VM backups and not for Azure SQL Database automated backups. Option D (Automated backup policy) refers to the default backup settings but does not include long-term retention.

93
MCQhard

Refer to the exhibit. You are monitoring index fragmentation in an Azure SQL Database. You need to automate the rebuild of this index when fragmentation exceeds 50%. The rebuild must be online to minimize downtime. Which T-SQL statement should you include in your automated maintenance job?

A.ALTER INDEX Orders ON Orders REBUILD;
B.ALTER INDEX ALL ON Orders REBUILD WITH (ONLINE = ON);
C.ALTER INDEX ALL ON Orders REORGANIZE;
D.ALTER INDEX ALL ON Orders REBUILD WITH (ONLINE = OFF);
AnswerB

Online rebuild minimizes downtime.

Why this answer

It uses the `ALTER INDEX ALL ON Orders REBUILD WITH (ONLINE = ON)` statement, which rebuilds all indexes on the table online, allowing concurrent user access and minimizing downtime. This meets the requirement to automate the rebuild when fragmentation exceeds 50%, as online rebuilds are supported in Azure SQL Database for this purpose.

Exam trap

The trap here is that candidates often confuse `REORGANIZE` with `REBUILD` for high fragmentation, or they overlook the `ONLINE = ON` option, assuming all rebuilds are online by default in Azure SQL Database.

How to eliminate wrong answers

Option A is wrong because it only rebuilds the index named 'Orders' (which is likely the table name, not an index name) and defaults to offline mode, causing downtime. Option C is wrong because `REORGANIZE` is used for defragmentation below 30% and does not rebuild the index, so it is ineffective for fragmentation above 50%. Option D is wrong because it specifies `ONLINE = OFF`, which performs an offline rebuild, blocking user access and violating the requirement to minimize downtime.

94
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

Provides CI/CD, version control, and ability to roll back 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.

95
MCQeasy

Refer to the exhibit. The ARM template snippet configures auditing for an Azure SQL Database. Based on the configuration, which events are audited?

A.All data modification statements (DML).
B.Successful and failed database authentication attempts.
C.Only failed authentication attempts.
D.All database schema changes (DDL).
AnswerB

Both successful and failed authentication attempts are included, as per the groups listed.

Why this answer

The auditActionsAndGroups include SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP and FAILED_DATABASE_AUTHENTICATION_GROUP, which audit successful and failed logins respectively. Option A is wrong because data modification statements (DML) are not included. Option C is wrong because data modifications are not included.

Option D is wrong because only authentication events are listed.

96
MCQhard

Your company uses Azure SQL Managed Instance with transactional replication. You need to automate the monitoring of replication latency and send an alert if latency exceeds 5 minutes. You want to use Azure Monitoring capabilities. What is the most efficient solution?

A.Use Elastic Database Jobs to run a query on the distributor and log results to a table, then set up a logic app to check the table.
B.Monitor the 'Replication: Dist Delivery Latency' performance counter.
C.Create a SQL Agent job on the publisher that checks sys.dm_repl_sync_status and sends an email.
D.Create an Azure Monitor metric alert on the 'Log Send Queue Size' metric with a threshold of 300000 KB (approximately 5 minutes).
AnswerD

This metric directly reflects replication latency and can trigger alerts.

Why this answer

The most efficient solution because Azure Monitor provides built-in metrics for transactional replication on Azure SQL Managed Instance, such as 'Log Send Queue Size'. By creating a metric alert with a threshold of 300000 KB (which corresponds to approximately 5 minutes of latency at typical throughput), you can be notified automatically when latency exceeds this threshold. This approach uses native Azure Monitoring capabilities without requiring custom jobs or scripts.

Options A, B, and C are less efficient: A requires Elastic Database Jobs and a logic app; B uses a performance counter that is not directly exposed in Azure Monitor for SQL Managed Instance and is more complex to set up; C requires creating a SQL Agent job to check a DMV and send email, which is manual and not as scalable as Azure Monitor alerts.

97
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

Azure Monitor can alert on storage metrics and trigger email notifications.

Why this answer

Azure Monitor alerts can monitor metrics like 'storage_percent' for Azure SQL Database and trigger an action group configured to send email notifications. Option B (CDC with Logic Apps) captures data changes, not storage metrics. Option C (Elastic Database Job) is for executing T-SQL scripts across databases, not for alerts.

Option D (SQL Agent Mail) is not available in Azure SQL Database.

98
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.

99
MCQmedium

Your company has a policy that all Azure SQL Databases must have their performance data (DTU/CPU, memory, IO) monitored and analyzed weekly. You need to automate the generation of a weekly report summarizing the top 10 queries by average CPU time. What should you use?

A.Configure a Power BI dashboard that connects directly to Azure SQL Database Query Store.
B.Create an Azure Monitor Workbook that queries the Query Store.
C.Set up a SQL Agent job to run queries against sys.dm_exec_query_stats and email the results.
D.Use the Query Performance Insight blade in the Azure portal and schedule an export to a storage account.
AnswerA

Correct. Power BI dashboards can connect to Query Store, and scheduled email subscriptions can automate report distribution.

Why this answer

SQL Agent is not available in Azure SQL Database, making Option C incorrect. Option A is correct because Power BI can connect directly to Azure SQL Database's Query Store, and with a Power BI Pro license, you can schedule email subscriptions of the report, automating the weekly generation and distribution of the top 10 queries report.

100
MCQeasy

You need to automate the execution of a T-SQL script against an Azure SQL Database every hour. Which Azure service should you use?

A.Azure Data Factory
B.Elastic Database Jobs
C.Azure Logic Apps
D.Azure Automation
AnswerD

Azure Automation with a runbook can schedule and execute T-SQL scripts.

Why this answer

Azure Automation with a runbook can run PowerShell or Python scripts that execute T-SQL against Azure SQL Database on a schedule. Option A is wrong because Azure Data Factory is focused on data movement and transformation, not direct T-SQL execution. Option B is wrong because Elastic Database Jobs require a job agent and are designed for management tasks across multiple databases, not simple hourly script execution.

Option C is wrong because Azure Logic Apps is geared towards integration workflows, and while it can execute SQL, it is less efficient than Azure Automation for this straightforward scheduling task.

101
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.

102
MCQmedium

You are a database administrator for a healthcare company that uses Azure SQL Database with Hyperscale tier. The database contains patient records and is critical for operations. You need to automate the process of refreshing the staging database from the production database every night. The refresh process must occur during a maintenance window from 2:00 AM to 4:00 AM. The solution must use point-in-time restore to ensure consistency and must minimize the storage costs. Additionally, the automation must notify the operations team if the refresh fails. What should you do?

A.Use Elastic Database Jobs to run a T-SQL script that uses RESTORE DATABASE from a backup file.
B.Create an Azure Automation runbook that performs a point-in-time restore of the production database to a new database, then renames the databases to swap staging. Schedule the runbook during the maintenance window and configure alerts for failure.
C.Use Azure Data Factory to copy data from production to staging using a copy activity.
D.Use Azure SQL Database export to BACPAC from production and import to staging using Azure Automation.
AnswerB

Correct. Azure Automation runbook with PITR and database rename swap meets all requirements: automation, maintenance window, consistency, cost savings, and failure notification via alerts.

Why this answer

Azure Automation runbooks can schedule a point-in-time restore of the production database to a new database, then rename the databases to swap them, making the restored database the new staging database. This leverages the Hyperscale tier's fast restore and minimizes storage costs by avoiding multiple copies. Alerts can be configured to notify the operations team on failure.

Option A is incorrect because Elastic Database Jobs cannot perform restore operations; they are for running T-SQL scripts across databases, not restoring from backups. Option C is incorrect because Azure Data Factory is an ETL tool and cannot perform point-in-time restore of a database. Option D is incorrect because export/import via BACPAC is slower, more expensive, and does not guarantee point-in-time consistency.

Exam trap

Candidates may think that renaming databases after restore is complex, but Azure SQL Database supports renaming databases via T-SQL or PowerShell, making the swap straightforward.

103
Matchingmedium

Match each Azure SQL Database command to its function.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Sets database-level configuration options

Clears the procedure cache

Changes the recovery model of the database

Creates a database as a copy of another database

Why these pairings

In Azure SQL Database, CREATE DATABASE initializes a new database, ALTER DATABASE changes its configuration, DROP DATABASE removes it, and BACKUP DATABASE creates a backup (though backups are often automatic). Common confusions include swapping CREATE with DROP and ALTER with BACKUP due to similar administrative contexts.

104
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 can create metric alerts for storage usage.

Why this answer

Azure Monitor alerts can be configured to trigger based on metrics like storage percent, enabling automatic notification when an Azure SQL Database reaches 80% storage usage. Option A is incorrect because Azure Automation is used for runbooks and process automation, not for alerting. Option B is incorrect because Microsoft Sentinel is a SIEM solution for security analytics, not for simple metric alerts.

Option C is incorrect because Azure Logic Apps can be triggered by alerts, but the alert itself must be created in Azure Monitor.

105
MCQmedium

Your team uses Azure DevOps to deploy database changes to Azure SQL Database. You need to automate the generation and deployment of database schema changes based on a Git branch merge. Which Azure service should you integrate?

A.Azure Automation Runbook triggered by a webhook from Azure DevOps.
B.Azure Pipelines with a release pipeline that uses the Azure SQL Database deployment task.
C.GitHub Actions with a workflow that runs on pull request merge, using the Azure SQL action.
D.Azure Logic Apps with an HTTP trigger from Azure DevOps, then use SQL connector to run scripts.
AnswerB

Azure Pipelines natively supports database deployments.

Why this answer

Azure Pipelines (part of Azure DevOps) can be configured to trigger on branch merges and includes a built-in Azure SQL Database deployment task for automating schema changes. Option A is wrong because Azure Automation Runbooks are not designed for CI/CD workflows. Option C is wrong because GitHub Actions would require moving outside the existing Azure DevOps ecosystem.

Option D is wrong because Azure Logic Apps are meant for integration workflows, not CI/CD pipeline automation.

106
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 deployment task executes the schema change.

Why this answer

Options A, B, and C are correct. A release pipeline with the 'Azure SQL Database deployment' task automates the deployment. A SQL database project (.sqlproj) defines the schema to deploy.

A service connection to Azure with appropriate permissions is needed for authentication and authorization. Option D is incorrect because while a schema compare tool can be used to generate scripts, it is not a strict requirement; the deployment task can handle the deployment directly from the project. Option E is incorrect because a self-hosted build agent is not required; Microsoft-hosted agents can be used.

107
MCQhard

You are reviewing an ARM template snippet that configures a Security Alert Policy for an Azure SQL Database. The policy is enabled, and email notifications are sent to the account admin and admin@contoso.com. However, you notice that SQL Injection alerts are disabled. What is the most likely reason for disabling SQL Injection alerts?

A.To reduce the number of false positives and save costs on alert processing.
B.Because the database is configured with a conflicting vulnerability assessment policy that overrides SQL injection detection.
C.Because SQL injection alerts are incompatible with the chosen storage account endpoint.
D.Because SQL injection detection is already handled by Microsoft Defender for SQL.
AnswerD

Microsoft Defender for SQL provides advanced threat protection, so the basic alert policy may be disabled to avoid duplication.

Why this answer

Microsoft Defender for SQL provides built-in SQL injection detection, which can supersede the need for separate Security Alert Policy rules. When Defender for SQL is enabled, it automatically monitors and alerts on SQL injection attempts, so duplicating with a custom alert policy would be redundant and could cause confusion. Option A is incorrect because disabling alerts does not save costs; it weakens security.

Option B is incorrect because vulnerability assessment policies do not override alert rules. Option C is incorrect because there is no known incompatibility between SQL injection alerts and storage account endpoints.

108
Multi-Selectmedium

Which TWO of the following are valid methods to automate backups for Azure SQL Managed Instance? (Select exactly two.)

Select 2 answers
A.Use Azure Backup to schedule full backups.
B.Schedule T-SQL BACKUP DATABASE TO URL statements via SQL Agent jobs.
C.Use Azure Site Recovery to replicate the instance.
D.Configure long-term retention (LTR) policies on the managed instance.
E.Use Azure VM backup by installing the backup extension.
AnswersB, D

SQL Agent jobs can automate copy-only backups to Azure Blob.

Why this answer

Options B and D are correct. Azure SQL Managed Instance supports automated backups through the service's built-in point-in-time restore (PITR) and long-term retention (LTR) policies (option D). Additionally, you can schedule manual copy-only backups to Azure Blob Storage using T-SQL BACKUP DATABASE TO URL statements via SQL Agent jobs (option B).

Option A is incorrect because Azure Backup does not natively support Azure SQL Managed Instance. Option C is incorrect because Azure Site Recovery is a disaster recovery solution, not a backup service. Option E is incorrect because Azure VM backup is designed for IaaS virtual machines, not for PaaS managed instances.

109
Multi-Selecthard

You are designing an automation strategy for an Azure SQL Database that requires the following: 1) Automatically scale up the service tier when CPU usage exceeds 90% for 5 minutes. 2) Automatically scale down when CPU usage drops below 10% for 15 minutes. 3) The solution must be cost-effective and use built-in Azure features. Which TWO options should you combine? (Choose two.)

Select 2 answers
A.Elastic Database Jobs
B.Azure Monitor autoscale
C.Azure Functions
D.Azure Logic Apps with a metric trigger
E.Azure Automation runbook
AnswersD, E

Logic Apps can monitor metrics and trigger actions.

Why this answer

Azure Logic Apps can trigger scaling actions based on metric thresholds using a metric trigger, and Azure Automation runbooks can execute the scaling commands (such as changing the service tier) via PowerShell or Azure CLI. Together, they provide a cost-effective, built-in solution. Option A (Elastic Database Jobs) is used for scheduled database tasks like index maintenance, not scaling.

Option B (Azure Monitor autoscale) is not directly available for Azure SQL Database; autoscale is only for Azure Virtual Machine scale sets, App Service, etc. Option C (Azure Functions) could also be used, but the recommended combination for this scenario is Logic Apps and Automation runbooks because they are serverless and integrate natively with Azure SQL Database.

110
MCQhard

You have an Azure SQL Database that needs to be automatically scaled up during peak hours and scaled down during off-peak. The solution must use native Azure capabilities without custom code. What should you use?

A.Use Azure Functions with timer trigger and PowerShell to change the pricing tier.
B.Configure autoscale for the elastic pool that contains the database.
C.Configure autoscale settings on the Azure SQL Database server.
D.Create Elastic Database Jobs that run ALTER DATABASE to change the service objective at scheduled times.
AnswerD

Elastic Jobs can execute T-SQL to modify the database's service tier on a schedule.

Why this answer

Elastic Database Jobs can be used to run ALTER DATABASE statements on a schedule, enabling automated scaling without custom code. Option A is wrong because it requires custom code (PowerShell) and is not a native Azure SQL capability. Option B is wrong because autoscale for elastic pools adjusts per-database DTUs, not the overall database service objective, and does not support scheduled scaling.

Option C is wrong because autoscale settings are not available for Azure SQL Database at the server level.

111
MCQmedium

You manage an Azure SQL Database that must run a maintenance task every Sunday at 2:00 AM UTC. The task must be resilient to failures and automatically retry if it fails. You need to configure this using Azure automation. What is the most appropriate solution?

A.Create an Azure Logic App with a recurrence trigger scheduled for Sunday at 2:00 AM UTC and configure a retry policy.
B.Create an Azure Automation Runbook and schedule it to run weekly. Add custom error handling for retries.
C.Use T-SQL Agent job in Azure SQL Database with a schedule and set up retry via Transact-SQL.
D.Create an Azure Function with a timer trigger and implement retry logic in code.
AnswerA

Logic Apps provide built-in scheduling and retry policies.

Why this answer

The most appropriate solution because Azure Logic Apps provides a recurrence trigger that can be scheduled to run at specific times (e.g., every Sunday at 2:00 AM UTC) and includes built-in retry policies to handle failures, ensuring resilience without custom code. Option B (Azure Automation Runbook) can be scheduled and can include custom error handling for retries, but it requires more manual implementation and is less integrated for simple retry logic. Option C (T-SQL Agent job) is not available in Azure SQL Database; Azure SQL Database does not support SQL Agent jobs natively.

Option D (Azure Function with timer trigger) requires custom retry logic in code, which is more complex than using Logic Apps' built-in retry policy.

112
MCQeasy

You need to automate the process of scaling an Azure SQL Database up during peak hours and down during off-peak hours to optimize cost. The solution must be serverless and not require any custom infrastructure. What should you use?

A.Create a SQL Agent job that runs ALTER DATABASE MODIFY (SERVICE_OBJECTIVE = ...).
B.Create a scheduled Azure Logic App that uses the Azure SQL Database REST API to update the service objective.
C.Use an Elastic Job agent to run a script that changes the service objective.
D.Enable autoscale on the Azure SQL Database.
AnswerB

Logic Apps can automate scaling without additional infrastructure.

Why this answer

Azure Logic Apps can be scheduled to run a workflow that uses the Azure SQL Database REST API (or Azure Resource Manager REST API) to update the service objective (DTU or vCore) of an Azure SQL Database. This enables automated scaling without custom infrastructure. Option A is incorrect because SQL Agent jobs run within the SQL Server context and cannot directly change the service objective; the ALTER DATABASE MODIFY (SERVICE_OBJECTIVE) command is not valid.

Option C is incorrect because Elastic Job agents are designed for executing T-SQL scripts across multiple databases, not for changing service tiers. Option D is incorrect because Azure SQL Database does not support autoscale; scaling must be performed manually or programmatically.

113
MCQmedium

You have an Azure SQL Database that uses SQL Server Agent for automation tasks. You migrated the database to Azure SQL Managed Instance. After migration, some SQL Server Agent jobs fail because they reference a linked server that no longer exists. You need to automate the removal of all linked server references from the jobs. What should you do?

A.Use elastic jobs to remove the linked server references.
B.Create a T-SQL script that updates the job steps to remove linked server references, and execute it via Azure Automation runbook.
C.Use Azure CLI to remove the linked server references.
D.Use Azure Automation to run a PowerShell script that removes the linked server references.
AnswerB

A T-SQL script can modify SQL Agent jobs, and Azure Automation can execute it.

Why this answer

You can create a T-SQL script that updates the job steps to remove linked server references and execute it via Azure Automation runbook. This allows automated execution against the SQL Managed Instance. Option A is incorrect because elastic jobs are used for scheduling tasks across multiple databases, not for modifying SQL Agent jobs directly.

Option C is incorrect because Azure CLI does not have native commands to manage SQL Agent jobs. Option D is incorrect because while Azure Automation can run PowerShell scripts, the T-SQL script approach is more direct and reliable for modifying job steps.

114
Matchingmedium

Match each Azure SQL Database high availability feature to its description.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Asynchronous replication to a secondary region

Group of databases that fail over together

Replicas across different availability zones

Data replicated within a single datacenter

Why these pairings

These features provide different levels of availability and disaster recovery for Azure SQL Database.

115
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.

116
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 session and does not work in Azure Automation runbooks.

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.

117
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

Metric alerts can trigger runbooks to scale the database.

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.

118
MCQhard

Your company uses Azure SQL Managed Instance and needs to automate patching and maintenance. The compliance team requires that all maintenance windows be predefined and that no maintenance occurs outside these windows. What should you configure?

A.Configure a maintenance configuration for the virtual machine scale set
B.Set a maintenance window in the Azure SQL Database server settings
C.Use Azure Update Management to schedule patching
D.Assign a maintenance configuration to the SQL Managed Instance
AnswerD

Azure Maintenance Configurations allow you to define maintenance windows for SQL Managed Instance.

Why this answer

Azure Maintenance Configurations allow you to schedule maintenance windows for Azure SQL Managed Instance, ensuring compliance. Option A is for Azure VMs, not SQL MI. Option B is for patching at the OS level, not applicable.

Option C is for Azure SQL Database, not Managed Instance.

119
MCQmedium

Your Azure SQL Database is configured with active geo-replication. You need to automate the failover process in case of a regional outage. The solution should ensure minimal data loss and support testing without affecting the production environment. What should you use?

A.Configure an Azure Traffic Manager profile with endpoint monitoring and failover.
B.Use Azure Load Balancer with a health probe to redirect traffic.
C.Create an Azure Automation runbook that monitors health and executes a manual failover using PowerShell cmdlet Start-AzSqlDatabaseFailover.
D.Enable automatic failover for the geo-replication group.
AnswerC

Azure Automation can run a script to check health and trigger failover, providing automated response while allowing manual testing.

Why this answer

Azure SQL Database active geo-replication supports manual failover only; automatic failover is not available. To automate the process, you can use Azure Automation runbooks that invoke the Start-AzSqlDatabaseFailover cmdlet. This allows for scheduled or monitored failover, supports testing by targeting the secondary replica, and minimizes data loss by ensuring the primary is synchronized before failover.

Option A is incorrect because Azure Traffic Manager performs DNS-level routing, not database failover. Option B is incorrect because Azure Load Balancer is for network traffic distribution, not SQL database failover. Option D is incorrect because geo-replication does not provide automatic failover; failover must be initiated manually or via automation.

120
MCQeasy

You are reviewing an Azure CLI command that creates an elastic job step. The job step is intended to rebuild all indexes on the Sales.Orders table, but the job fails. What is the error in the JSON configuration?

A.The command is missing a semicolon at the end.
B.The target group should specify 'SqlServer' type instead of 'SqlDatabase'.
C.The command should be 'REBUILD INDEX' instead of 'ALTER INDEX'.
D.The job agent version is incompatible with the command.
AnswerA

T-SQL statements should end with a semicolon in elastic job steps.

Why this answer

The T-SQL command 'ALTER INDEX ALL ON Sales.Orders REBUILD' must end with a semicolon to be valid in an Azure Elastic Job step. Without the semicolon, the job fails. Option B is incorrect because the target group type for a single database is 'SqlDatabase'.

Option C is incorrect because 'ALTER INDEX ... REBUILD' is the correct syntax. Option D is incorrect because there is no version incompatibility.

121
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.

122
MCQmedium

Refer to the exhibit. You execute this PowerShell script to automate database configuration. The script runs without errors, but the database remains in the 'Standard' edition with S2 performance level. What is the most likely reason?

A.The elastic pool does not exist
B.The -RequestedServiceObjectiveName parameter is misspelled
C.The database is being moved into an elastic pool, which overrides the edition and SLO
D.The script requires administrative privileges that the user does not have
AnswerC

When specifying ElasticPoolName, the database inherits the pool's service tier.

Why this answer

When the -ElasticPoolName parameter is specified, the database is moved into the elastic pool, and the -Edition and -RequestedServiceObjectiveName parameters are ignored because the elastic pool's service tier and performance level determine the database's settings. The script runs without errors, but the database remains at Standard S2 because the pool's tier overrides the specified edition and SLO. Option A is incorrect because the command succeeded, indicating the pool exists.

Option B is incorrect because the parameter is correctly spelled. Option D is incorrect because the script succeeded without privilege errors.

123
MCQhard

Your company uses Azure SQL Managed Instance for a critical OLTP workload. You need to automate index maintenance for all databases in the instance without downtime. The solution must minimize performance impact during business hours. Which approach should you use?

A.Use Elastic Database Jobs to run index maintenance scripts on all databases during off-peak hours, with parallel execution throttled.
B.Use Azure Logic Apps with a SQL connector to run index maintenance on each database, with retry policies.
C.Create an Azure Automation Runbook that connects to each database and runs index maintenance sequentially.
D.Deploy Ola Hallengren’s IndexOptimize stored procedure in each database and schedule it via SQL Server Agent.
AnswerD

Ola Hallengren's IndexOptimize stored procedure is a widely used, efficient solution for index maintenance. SQL Server Agent is fully supported on Azure SQL Managed Instance and can be scheduled to run during off-peak hours with custom configuration to minimize performance impact.

Why this answer

Azure SQL Managed Instance fully supports SQL Server Agent, which can schedule Ola Hallengren's IndexOptimize stored procedure for index maintenance across all databases. This approach allows centralized management, scheduling during off-peak hours, and granular control over parallelism and throttling to minimize performance impact. Option A is incorrect because Elastic Database Jobs are not available on Azure SQL Managed Instance; they are designed for Azure SQL Database.

Option B is incorrect because Azure Logic Apps are not suited for executing T-SQL scripts across multiple databases with performance-sensitive throttling. Option C is incorrect because Azure Automation Runbooks would require complex orchestration and lack native scheduling and throttling capabilities compared to SQL Agent.

124
Multi-Selecteasy

Which TWO Azure services can be used to automate the execution of T-SQL scripts on a schedule against Azure SQL Database?

Select 2 answers
A.Azure Logic Apps with SQL connector to execute stored procedures.
B.Azure Automation Hybrid Runbook Worker with PowerShell Invoke-SqlCmd.
C.Azure Functions with timer trigger and SqlConnection.
D.Elastic Database Jobs with T-SQL script execution.
E.Azure Data Factory with a SQL Server Stored Procedure activity.
AnswersB, D

Hybrid Runbook Worker can run scripts on schedule.

Why this answer

Options B and D are correct. Azure Automation Hybrid Runbook Worker can execute T-SQL scripts using PowerShell Invoke-SqlCmd on a schedule, making it suitable for automating script execution against Azure SQL Database. Elastic Database Jobs are specifically designed to run T-SQL scripts on a schedule across one or more Azure SQL databases.

Option A is incorrect because Azure Logic Apps with SQL connector is better suited for workflows and not primarily for scheduled T-SQL script execution. Option C is incorrect because Azure Functions, while capable of running code with timer triggers, is not the optimal service for scheduled T-SQL scripts; Elastic Database Jobs is the dedicated solution. Option E is incorrect because Azure Data Factory is focused on data movement and orchestration, not direct scheduled execution of T-SQL scripts.

125
Multi-Selectmedium

You are designing an automation solution to deploy Azure SQL Database schema changes using CI/CD pipelines. The solution must support rollback if a deployment fails and must integrate with Azure DevOps. Which two components should you include in your pipeline?

Select 2 answers
A.Azure Automation runbook to execute T-SQL scripts.
B.Azure Data Factory pipeline to copy schema changes.
C.A PowerShell script that uses Invoke-SqlCmd to deploy to Azure SQL Managed Instance.
D.Azure SQL Database project with DACPAC deployment.
E.Azure SQL Database deployment task in Azure Pipelines.
AnswersD, E

using an Azure SQL Database project with DACPAC (data-tier application package) allows version-controlled, repeatable schema deployments and supports rollback by redeploying a previous DACPAC.

Why this answer

Using an Azure SQL Database project with DACPAC (data-tier application package) allows version-controlled, repeatable schema deployments and supports rollback by redeploying a previous DACPAC. Option E is correct because the Azure SQL Database deployment task in Azure Pipelines can deploy DACPACs or execute SQL scripts as part of a CI/CD pipeline, enabling rollback through previous pipeline runs. Option A is incorrect: Azure Automation runbooks are designed for operational tasks like incident remediation, not for CI/CD schema deployment.

Option B is incorrect: Azure Data Factory is an ETL service, not for schema change management. Option C is incorrect: although PowerShell with Invoke-SqlCmd can run scripts, it lacks built-in rollback support and is not a CI/CD component; also, Azure SQL Managed Instance is a different deployment option, but the question is about Azure SQL Database.

126
Multi-Selectmedium

You have an Azure SQL Database that runs a critical workload. You need to automate the monitoring of performance anomalies and receive notifications when certain thresholds are exceeded. Which TWO actions should you implement? (Choose two.)

Select 2 answers
A.Create a Power BI report that refreshes every minute.
B.Enable Query Store and set up email notifications for high query duration.
C.Configure a SQL Agent alert on performance counters.
D.Enable SQL Insights (preview) for intelligent performance monitoring.
E.Create an Azure Monitor alert rule on DTU/CPU and storage metrics.
AnswersD, E

SQL Insights provides advanced monitoring and anomaly detection.

Why this answer

Options D and E are correct. Enabling SQL Insights (preview) provides intelligent performance monitoring with built-in anomaly detection, and creating an Azure Monitor alert rule on DTU/CPU and storage metrics enables automated notifications when thresholds are exceeded. Option A is incorrect because Power BI is a reporting tool, not designed for real-time alerting on performance anomalies.

Option B is incorrect because Query Store tracks query performance but does not natively support email notifications. Option C is incorrect because SQL Agent alerts are for job scheduling events, not for monitoring performance counters like DTU or CPU.

127
MCQhard

You are a database administrator for a financial services company. The company has multiple Azure SQL Managed Instances in different regions for disaster recovery. Each Managed Instance hosts several databases. You need to automate the process of backing up all databases and copying the backup files to a central Azure Blob Storage account for long-term retention. The backup must be taken daily at 10 PM local time for each region. The solution must be resilient to regional outages and must not use native backup retention more than 7 days. Additionally, you must ensure that backup files are encrypted at rest and in transit. What should you do?

A.Configure a SQL Agent job on each Managed Instance to perform backups to the central storage account directly using BACKUP TO URL.
B.Create an Azure Automation account in each region with a PowerShell runbook that connects to the local Managed Instance, performs a full database backup to a local blob container, and then copies the backup file to the central storage account using AzCopy. Schedule the runbook to run daily at 10 PM local time.
C.Use Elastic Database Jobs to schedule backups across all databases in all Managed Instances.
D.Enable Azure Backup for SQL Server in Azure Backup vault and configure backup policies for each Managed Instance.
AnswerB

Azure Automation runbooks can be scheduled per region and provide resiliency.

Why this answer

Azure Automation accounts in each region with PowerShell runbooks can be scheduled to run daily at 10 PM local time. The runbook connects to the local Managed Instance, performs a full database backup to a local blob container (using BACKUP TO URL or similar), and then uses AzCopy to copy the backup file to the central storage account. This approach is resilient to regional outages because each region has its own automation account.

Option A is incorrect because managing SQL Agent jobs manually across instances is less automated and less resilient; also, backing up directly to a central storage account may be affected by network issues. Option C is incorrect because Elastic Database Jobs are not available for Azure SQL Managed Instance. Option D is incorrect because Azure Backup for SQL Server is designed for SQL Server on Azure VMs, not for Managed Instance.

128
MCQeasy

You need to run a complex T-SQL script on an Azure SQL Database every hour. The script performs data transformations that must be logged for auditing. Which native Azure service should you use?

A.SQL Agent job on the Azure SQL Database.
B.Elastic Database Jobs with a T-SQL job step.
C.Azure Data Factory with a stored procedure activity.
D.Azure Automation Account with a PowerShell runbook that uses Invoke-SqlCmd.
AnswerB

Elastic Jobs are purpose-built for scheduled T-SQL execution on Azure SQL DB with logging.

Why this answer

Elastic Database Jobs (option B) is the correct native Azure service for running complex T-SQL scripts on Azure SQL Database on a schedule with logging. It is designed for scheduled execution of T-SQL scripts across one or more databases and provides job logging and history. Option A is incorrect because SQL Agent is not available in Azure SQL Database single databases (only in SQL Server on VMs or Managed Instances).

Option C is incorrect because Azure Data Factory is primarily an ETL service, not optimized for simple scheduled script execution, though it can be used, it is not the native simple solution. Option D is incorrect because Azure Automation Runbooks execute PowerShell, not T-SQL directly; while Invoke-SqlCmd can be used, it is not the native T-SQL scheduling service.

129
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 provides CI/CD capabilities specifically for database deployments.

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.

130
MCQmedium

You manage an Azure SQL Database that supports a critical financial application. The database is in the General Purpose tier and uses active geo-replication for disaster recovery. You need to automate the process of failing over to the secondary region in case of a regional outage, but only after confirming that the primary is unreachable for more than 5 minutes. Additionally, you need to send an alert to the operations team when the failover occurs. The solution should use Azure services and minimize manual steps. What should you implement?

A.Use Azure Logic Apps with a timer trigger to check the database status every minute and initiate failover if unreachable.
B.Schedule a SQL Agent job on the secondary to run a script that checks connectivity and fails over.
C.Configure Azure Site Recovery for the SQL database.
D.Configure an Azure Monitor metric alert on the 'Deadlock count' metric (or custom metric) with a threshold of 0 for 5 minutes, then use an action group to trigger an Azure Automation runbook that runs the failover PowerShell cmdlet.
AnswerA

Correct. Logic Apps can be configured with a timer trigger to periodically check the primary database's connectivity. If unreachable for more than 5 minutes (e.g., after 5 consecutive failed checks), it can trigger a failover and send alerts. This uses Azure-native services and minimizes manual steps.

Why this answer

Azure Logic Apps can automate the failover process by periodically checking the primary database's connectivity. If it remains unreachable for more than 5 minutes, it can initiate a geo-replication failover and send alerts to the operations team. This meets all requirements using Azure services with minimal manual steps.

Option B is incorrect because SQL Agent is not available in Azure SQL Database as a PaaS service. Option C is incorrect because Azure Site Recovery is designed for virtual machines, not for Azure SQL Database geo-replication. Option D is incorrect because the 'Deadlock count' metric is unrelated to database connectivity; it measures deadlocks, not reachability, and the described threshold does not correctly detect unreachability.

131
Multi-Selectmedium

You are a database administrator for a company that uses Azure SQL Managed Instance. You need to automate the process of patching the operating system and SQL Server engine for all managed instances in a specific region. The automation must minimize downtime and ensure high availability. Which two actions should you include in your automation strategy?

Select 2 answers
A.Use Azure Policy to automatically scale up the instance before patching.
B.Create an Azure Automation runbook to manually apply OS and SQL patches.
C.Configure a maintenance window using Azure Portal or PowerShell.
D.Deploy a failover group to another region and enable read-scale replicas.
E.Enable Azure Update Manager for the managed instances.
AnswersC, D

Correct. Configuring a maintenance window allows you to control when patching occurs, minimizing impact.

Why this answer

Correct options are C and D. Configure a maintenance window (C) to control when patching occurs, minimizing disruption. Deploy a failover group to another region with read-scale replicas (D) to redirect traffic during patching, ensuring high availability.

Option A is incorrect because scaling up does not relate to patching; Azure Policy is for governance. Option B is incorrect because Microsoft manages patching for Azure SQL Managed Instance; manual patching is not supported. Option E is incorrect because Azure Update Manager is for IaaS VMs, not for Azure SQL Managed Instance.

Exam trap

Candidates may think that Azure Automation runbooks are necessary for patching automation, but patching is managed by Microsoft. They may also incorrectly believe that enabling Azure Update Manager applies to Azure SQL Managed Instance.

132
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

The job agent is required before creating jobs, targets, and credentials.

Why this answer

An elastic job agent is the top-level resource that orchestrates jobs. Before creating any jobs, you must create the elastic job agent. The job database (A) stores job definitions but is created as part of agent setup or after.

Target groups (C) and job credentials (D) are created after the agent exists.

133
Multi-Selectmedium

Which TWO options are valid services for scheduling automated tasks for Azure SQL Database? (Choose two.)

Select 2 answers
A.SQL Server Agent
B.Azure Functions
C.Azure Automation
D.Azure Logic Apps
E.Elastic Database Jobs
AnswersC, E

Azure Automation can run PowerShell or Python runbooks on a schedule to perform database tasks.

Why this answer

Azure Automation is correct because it provides a cloud-based automation and configuration service that supports scheduling PowerShell or Python runbooks to execute tasks against Azure SQL Database, such as running T-SQL scripts or performing maintenance operations. It integrates natively with Azure SQL via the Az module and can be triggered on a recurring schedule, making it a valid service for scheduling automated tasks.

Exam trap

The trap here is that candidates often confuse SQL Server Agent (available in SQL Server and Azure SQL Managed Instance) with Elastic Database Jobs (the equivalent for Azure SQL Database), or they assume Azure Functions or Logic Apps are the correct scheduling services when the question specifically asks for services designed for scheduling automated tasks for Azure SQL Database.

134
MCQmedium

You are managing an Azure SQL Database that runs a critical business application. The database experiences a predictable surge in read-only queries every night at 2:00 AM. You need to configure automatic scaling to handle this surge without manual intervention. What should you do?

A.Create a read replica and redirect read queries to it during the surge.
B.Manually scale up the database service tier before 2:00 AM each day.
C.Move the database to an Elastic Database Pool and rely on its built-in autoscaling.
D.Configure autoscale settings on the Azure SQL Database using Azure Automation runbooks triggered by a metric alert.
AnswerD

This enables automatic scaling based on load.

Why this answer

Azure SQL Database does not natively support automatic scaling based on load. To achieve this, you must use Azure Automation runbooks triggered by a metric alert (e.g., DTU or CPU percentage) to programmatically scale the database's service tier up or down. This approach allows you to handle the predictable nightly surge without manual intervention, as the runbook can be scheduled or triggered by a threshold alert.

Exam trap

The trap here is that candidates often assume Azure SQL Database has built-in autoscaling like Azure SQL Database serverless (which only pauses/resumes, not scales), or they confuse elastic pool autoscaling with per-database scaling, leading them to select option C incorrectly.

How to eliminate wrong answers

Option A is wrong because creating a read replica and redirecting read queries does not scale the primary database; it only offloads read traffic, and the replica itself is not automatically scaled to handle the surge. Option B is wrong because manually scaling the database before 2:00 AM each day requires ongoing manual intervention, which contradicts the requirement to configure automatic scaling without manual intervention. Option C is wrong because Elastic Database Pools provide resource sharing and autoscaling at the pool level (adding/removing eDTUs), but they do not automatically scale individual databases within the pool; the pool's autoscaling is based on aggregate pool metrics, not per-database surge patterns.

135
MCQeasy

You need to automate the process of scaling an Azure SQL Database to a higher service tier when CPU usage exceeds 80% for 5 consecutive minutes. Which Azure service is best suited for this automation?

A.Azure Logic App triggered by an Azure Monitor metric alert, calling the Azure SQL Database REST API to update the tier.
B.Elastic Database Job that monitors sys.dm_db_resource_stats and executes ALTER DATABASE.
C.Azure Automation Runbook triggered by an Azure Monitor alert, using PowerShell to scale the database.
D.Azure Function triggered by an Azure Monitor alert, using the Azure SDK to scale.
AnswerA

Logic Apps have native integration with Azure Monitor alerts and REST APIs.

Why this answer

Azure Logic Apps can be easily triggered by an Azure Monitor metric alert and can call the Azure SQL Database REST API to update the service tier. This provides a simple, low-code solution for automating scaling based on CPU thresholds. Option B is incorrect because Elastic Database Jobs are designed for executing T-SQL scripts across multiple databases, not for scaling operations.

Option C is incorrect: although Azure Automation Runbooks can be triggered by alerts and use PowerShell, they require more setup and overhead compared to Logic Apps. Option D is also less optimal: Azure Functions can work but Logic Apps offer a more straightforward integration with Azure Monitor alerts and REST APIs for this specific use case.

136
MCQmedium

You are managing an Azure SQL Managed Instance that hosts a critical database. You need to automate the export of daily backups to a storage account for long-term retention. The solution must minimize administrative overhead and support point-in-time restore within the retention period. What should you use?

A.Configure a long-term retention (LTR) backup policy for the Managed Instance.
B.Configure an Azure Backup policy for the Managed Instance.
C.Schedule a BACPAC export of the database to the storage account.
D.Create a SQL Agent job to perform backups using BACKUP DATABASE TO URL.
AnswerA

LTR policies automate backup exports to storage accounts and support point-in-time restore.

Why this answer

Azure SQL Managed Instance supports configuring a long-term retention (LTR) backup policy that automatically stores backups in a geo-redundant storage account for up to 10 years, minimizing administrative overhead while supporting point-in-time restore within the retention period. Option B is incorrect because Azure Backup is designed for IaaS VMs and other workloads, not for SQL Managed Instance native backups. Option C is incorrect because scheduling BACPAC exports is not a backup solution — it does not support point-in-time restore and requires manual setup.

Option D is incorrect because using SQL Agent jobs with BACKUP DATABASE TO URL adds complexity and does not integrate with Azure's automated backup management.

137
MCQhard

You have an Azure SQL Database that uses a SQL Agent job to run a critical ETL process every night. The job recently started failing intermittently. You need to automate the monitoring and alerting of job failures, and automatically retry the job twice with a 10-minute interval between retries. What should you configure?

A.Modify the job to use a T-SQL loop that checks job history and re-runs the job step.
B.Use Microsoft Power Automate to poll the job history and re-run the job if failed.
C.Create an Azure Monitor alert on the job failure event and use a webhook to trigger a PowerShell script that retries the job.
D.Configure the job step's 'Retry attempts' and 'Retry interval (minutes)' settings in the SQL Agent job step properties.
AnswerD

SQL Agent job steps have built-in retry configuration.

Why this answer

SQL Agent job steps have built-in 'Retry attempts' and 'Retry interval (minutes)' settings that allow you to configure automatic retries directly in the job step properties. This is the simplest and most native way to retry a failed job step. Option A is incorrect because a T-SQL loop checking job history is complex and not an automated built-in feature.

Option B is incorrect because Power Automate polling is an external solution that adds unnecessary complexity. Option C is incorrect because Azure Monitor alerts can notify but do not automatically retry the job; they would require additional logic (e.g., webhook to PowerShell) which is not native or as reliable as the built-in retry settings.

138
MCQhard

You have an Azure SQL Database configured with active geo-replication. You need to automate the failover process in the event of a regional outage, ensuring minimal data loss and automatic failback when the primary region recovers. What should you implement?

A.Configure an auto-failover group with a grace period of 1 hour.
B.Set up a PowerShell script that checks primary database health and initiates failover.
C.Use a ScheduledExecutorService in a Java application to monitor and failover.
D.Enable geo-replication and manually trigger failover when needed.
AnswerA

Auto-failover groups automate failover and failback, and the grace period allows for data loss tolerance.

Why this answer

Azure SQL Database auto-failover groups provide automated failover and failback with a grace period for data loss tolerance. Option B is wrong because it does not automate failover. Option C is wrong because manual failover does not provide automatic failback.

Option D is wrong because ScheduledExecutorService is a manual workaround that does not integrate with Azure failover groups.

139
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

Stores job definitions and execution history.

Why this answer

Elastic Database Jobs require a job database to store metadata, a job agent to orchestrate, and target databases. SQL Agent is not required. Elastic pool is optional.

Azure Automation is not required.

140
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

Automation is needed to run the export on a recurring schedule.

Why this answer

To automate the export of an Azure SQL Database to a BACPAC file on a monthly basis, you need a storage location for the file and an automation method. Option B is correct because Azure Automation or an Azure Function can trigger the Export-AzSqlDatabase cmdlet or REST API to perform the export on a schedule. Option E is correct because an Azure Storage account with a container is required to store the resulting BACPAC file.

Option A is incorrect because LTR policy is for automated backups, not export to BACPAC. Option C is incorrect because a SQL Server on Azure VM is not needed; the export is initiated directly against the Azure SQL Database logical server. Option D is incorrect because SSIS is an ETL tool that is not necessary for a simple export operation; the export can be done via PowerShell, CLI, or REST API without SSIS.

141
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 ideal for repeatable deployments and version control.

Why this answer

ARM templates provide a declarative, Infrastructure-as-Code approach that is repeatable and can be version-controlled. Option B is wrong because while PowerShell can automate, it is procedural and not as easily version-controlled or idempotent as ARM templates. Option C is wrong because the Azure portal is manual and not repeatable.

Option D is wrong because SSMS scripting is also manual and not suitable for automated deployment.

142
MCQhard

You are a database administrator for a large e-commerce company that uses Azure SQL Database for its transactional systems. The environment consists of 50 databases across 10 logical servers, each with a mix of General Purpose and Business Critical service tiers. The company has a strict requirement to automatically scale databases based on workload patterns to optimize cost without manual intervention. Specifically, during Black Friday sales, one of the Business Critical databases (DB-Sales) experiences a surge in transactions, and you need to temporarily upgrade it to a higher service objective (S9 instead of S6) for 48 hours. After the sale, it should automatically revert to S6. Additionally, you need to ensure that all databases have automated backups with a 35-day point-in-time restore retention and that backup storage costs are minimized by using geo-redundant storage only for critical databases. You have been asked to design an automation solution using Azure native services. Which approach should you recommend?

A.Use Elastic Job agents to run a script that alters the service objective and configure backup retention using the Azure portal.
B.Enable autoscale on the database to automatically adjust service objective based on CPU usage.
C.Create a SQL Server Agent job that runs ALTER DATABASE MODIFY (SERVICE_OBJECTIVE = 'S9') and configure backup retention using T-SQL.
D.Use Azure Automation Runbooks scheduled to run before and after Black Friday to change the service objective, and set backup retention policies using Azure Policy.
AnswerD

Azure Automation Runbooks can be scheduled to change service objectives, and Azure Policy can enforce backup retention.

Why this answer

Azure Automation Runbooks can be scheduled to execute PowerShell scripts that change the service objective of an Azure SQL Database (e.g., Set-AzSqlDatabase with the -RequestedServiceObjectiveName parameter). This allows scheduling a scale-up before Black Friday and a scale-down after 48 hours, meeting the temporary upgrade requirement. Additionally, Azure Policy can enforce backup retention policies (e.g., 35-day PITR) and specify geo-redundant storage only for critical databases, ensuring compliance and cost minimization.

Option A is incorrect because Elastic Job agents are for executing T-SQL scripts across many databases, not for scheduling one-off scaling actions, and backup retention via portal is not automated. Option B is incorrect because Azure SQL Database's autoscale feature is only available in the serverless compute tier, not for provisioned service objectives like S6/S9, and it adjusts based on workload automatically, not on a scheduled temporary upgrade basis. Option C is incorrect because SQL Server Agent is not available in Azure SQL Database (it's used in SQL Server on-premises or Azure SQL Managed Instance), and ALTER DATABASE MODIFY SERVICE_OBJECTIVE is not supported in Azure SQL Database; scaling requires Azure PowerShell or REST API.

143
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

Managed Backup automates backup scheduling and retention, and supports point-in-time restore.

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.

144
MCQeasy

You need to automatically scale an Azure SQL Database based on workload patterns. The solution must use built-in Azure features and minimize manual intervention. Which feature should you configure?

A.Use Azure Data Factory to scale the database based on pipeline triggers.
B.Create an Azure Automation runbook that scales the database on a schedule.
C.Configure autoscale settings for the Azure SQL Database.
D.Use an elastic pool and manually adjust eDTUs.
AnswerC

Autoscale automatically adjusts resources based on workload.

Why this answer

Azure SQL Database supports built-in autoscale through the 'Autoscale' feature (serverless compute tier or DTU-based scaling policies), which automatically adjusts resources based on workload patterns without manual intervention. This is the only option that leverages a native Azure feature for dynamic, reactive scaling rather than scheduled or manual actions.

Exam trap

The trap here is that candidates confuse 'automation' (Azure Automation runbooks) with 'automatic scaling' (built-in autoscale), or mistakenly think Azure Data Factory can manage database scaling, when only the native autoscale feature provides dynamic, policy-driven scaling without manual intervention.

How to eliminate wrong answers

Option A is wrong because Azure Data Factory is an ETL/integration service, not a database scaling mechanism; pipeline triggers cannot directly modify Azure SQL Database service tier or compute resources. Option B is wrong because Azure Automation runbooks require custom scripting and scheduled execution, which is not 'built-in' automatic scaling and introduces manual maintenance overhead. Option D is wrong because manually adjusting eDTUs in an elastic pool contradicts the requirement to 'minimize manual intervention' and does not provide automatic scaling based on workload patterns.

145
Multi-Selecteasy

Which TWO actions can be performed using Azure Automation runbooks for Azure SQL Database? (Choose two.)

Select 2 answers
A.Deploy Azure Resource Manager templates
B.Execute T-SQL scripts against Azure SQL Database
C.Create SQL Agent jobs on Azure SQL Database
D.Scale an Azure SQL Database up or down
E.Manage on-premises SQL Server instances directly
AnswersB, D

Using Invoke-SqlCmd module.

Why this answer

Azure Automation runbooks can execute T-SQL scripts and scale databases. They cannot manage on-premises SQL Server directly (requires hybrid worker). SQL Agent jobs cannot be created in Azure SQL Database.

146
MCQhard

You are troubleshooting a failed automated backup for an Azure SQL Database. The backup policy is configured for geo-redundant storage (RA-GRS). You notice that the last successful backup was 48 hours ago. The database is still online and accessible. What is the most likely cause of the backup failure?

A.The backup storage account has been deleted or has incorrect firewall rules.
B.The database is experiencing high transaction log generation, exceeding the backup throughput limit.
C.The geo-replication link is broken, causing backup failures.
D.The database is in a paused state due to serverless compute.
AnswerB

High log generation can cause backup jobs to time out or fail, especially if the log backup rate is insufficient.

Why this answer

Azure SQL Database automated backups can fail if the database generates a high volume of transaction logs, causing the backup process to exceed its throughput limit or timeout. This can happen even if the database is online and accessible. Option A (storage account issues) would likely cause persistent failures for all backups, not just a single one.

Option C (geo-replication link) is unrelated to backup failure. Option D (paused state) would prevent backups entirely. Therefore, B is the correct answer.

147
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 automatically handle failover to the secondary region in the event of a disaster, providing built-in automation without additional setup.

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.

148
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

PowerShell runbooks can call Restore-AzSqlDatabase and run post-restore scripts.

Why this answer

Azure Data Factory supports copy activity but not native restore. Azure Automation with PowerShell runbooks can orchestrate the entire workflow. Azure SQL Database elastic jobs are for T-SQL tasks across databases but not for restore operations.

Azure Logic Apps can also orchestrate but is less suited for complex scripting.

149
Multi-Selecteasy

Which TWO methods can be used to automatically restart an Azure SQL Database after a maintenance operation?

Select 2 answers
A.Azure CLI az sql db pause/resume
B.Azure Portal stop/start
C.SQL Server Management Studio (SSMS) restart command
D.Elastic Database Job with ALTER DATABASE SET ONLINE
E.Azure Automation runbook with Start-AzSqlDatabase
AnswersA, E

Correct. The Azure CLI pause/resume commands can be scripted in automated workflows.

Why this answer

The Azure CLI `az sql db pause/resume` can be scripted and automated, effectively restarting the database. Option E is also correct because an Azure Automation runbook can use the `Start-AzSqlDatabase` cmdlet (and corresponding `Stop-AzSqlDatabase`) to stop and start the database, which achieves an automated restart. Options B, C, and D are incorrect: B is manual via the portal, C is manual via SSMS, and D's `ALTER DATABASE SET ONLINE` does not restart the database.

Exam trap

Candidates may mistakenly think only the Azure CLI pause/resume is automated, but Azure Automation runbooks with PowerShell cmdlets like Start-AzSqlDatabase also provide an automated restart method.

150
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

A plan guide forces the previous plan, and disabling the recommendation prevents automatic tuning from reverting it.

Why this answer

Creating a plan guide for the previous plan manually enforces that plan for the query, and disabling the automatic tuning recommendation for that specific query prevents the automatic tuning engine from forcing the same plan again. Option A is incorrect because reindexing may not resolve the regression and does not stop automatic tuning from forcing the bad plan. Option C is incorrect because disabling automatic tuning globally affects all queries unnecessarily.

Option D is incorrect because clearing the plan cache is only temporary and automatic tuning would likely force the same plan again.

← PreviousPage 2 of 3 · 163 questions totalNext →

Ready to test yourself?

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