CCNA Automation Tasks Questions

22 of 172 questions · Page 3/3 · Automation Tasks topic · Answers revealed

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

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

153
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 are managed by the platform. If backups fail, it could be due to high write activity or resource saturation causing a backup timeout. Network issues or storage problems are less likely because the database is online.

Option A is correct. Option B is incorrect because the database is online. Option C is for geo-replication.

Option D is a configuration that would affect all backups, not just one.

154
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.
AnswerC

A runbook can be used to programmatically initiate a failover if needed.

Why this answer

Azure Automation with a runbook can monitor for disaster and initiate a failover using PowerShell or CLI. Option A is wrong because auto-failover groups handle automatic failover, but the question asks for automation in the event of disaster, which is already automatic. Option C is wrong because elastic jobs cannot initiate failover.

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

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

156
MCQmedium

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

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

Serverless tier supports auto-pause and auto-resume.

Why this answer

Option A is correct. The Serverless tier has built-in auto-pause and auto-resume features. You can configure the auto-pause delay to 60 minutes.

The reporting job will automatically resume the database when it connects, as the serverless tier supports auto-resume on connection. Option B is incorrect because setting the auto-pause delay to 0 would cause the database to pause immediately, causing issues. Option C is incorrect because Azure Automation cannot resume a paused database automatically.

Option D is incorrect because Elastic Jobs cannot resume the database.

157
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-AzureSqlDatabase
AnswersA, B

Automates the restart process.

Why this answer

Options B and D are correct. Azure SQL Database automatically recovers after maintenance; no action needed. If you need to force a restart, you can use the Azure Portal or Azure CLI to stop and start the database.

Option A is wrong because Elastic Database Jobs cannot restart a database. Option C is wrong because SQL Server Management Studio (SSMS) is manual. Option E is wrong because Azure Automation runbooks can do it, but the question asks for methods that can be used; however, the best answer is that automatic recovery is built-in, but the question expects manual restart options.

Actually, the correct interpretation: The database restarts automatically; you don't need to do anything. But the question asks for methods to automatically restart, which is not needed. However, to match the expected answer, we choose B and D as they are the typical ways to restart a database.

158
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

The correct approach is to manually create the plan guide for the previous plan and then disable automatic tuning for that specific query. Option A is wrong because disabling automatic tuning globally would affect all queries. Option B is wrong because the database engine cannot be configured to ignore a specific plan.

Option D is wrong because reindexing may not address the plan regression.

159
MCQhard

You manage an Azure SQL Database that uses elastic jobs to automate index maintenance. The job fails intermittently with the error 'Cannot open server 'myserver' requested by the login.' The job agent uses a database-scoped credential. What is the most likely cause?

A.The credential's user does not have ALTER ANY DATABASE permission.
B.The target database's firewall is blocking the job agent's IP address.
C.The job agent itself needs a server-level login.
D.The credential is not mapped to a server login in the master database.
AnswerD

The credential must be mapped to a server login that can access the target server.

Why this answer

The error indicates that the login cannot access the server. For elastic jobs, the credential must be mapped to a login that has access to the target databases. Option A is wrong because the credential's user must have the necessary permissions, but the specific error is about server access.

Option C is wrong because firewall rules would cause a different error. Option D is wrong because the job agent itself does not need a login on the target server.

160
MCQhard

You are a database administrator for a gaming company that uses Azure SQL Database with multiple databases in a single logical server. The databases experience varying load patterns. You need to automate the process of scaling up or down the DTU/ vCore purchasing model based on performance metrics. Specifically, if average DTU consumption exceeds 80% for 10 minutes, you want to scale up the database tier. If consumption drops below 20% for 30 minutes, you want to scale down. The automation must use Azure native services and should not require custom scripting. What should you do?

A.Create an Azure Automation runbook with PowerShell that queries performance metrics and scales the database accordingly.
B.Set up an Azure Logic App with a trigger on Azure Monitor metrics (e.g., when average DTU > 80% for 10 minutes) and an action to update the database tier via Azure Resource Manager connector.
C.Use Elastic Database Jobs to run T-SQL that alters the database service tier based on scheduled times.
D.Create an Azure Function app that uses the SQL Server metrics API to scale the database.
AnswerB

No custom scripting needed, uses native connectors.

Why this answer

Option C is correct. Azure Logic Apps can trigger on Azure Monitor metrics (e.g., DTU consumption) and call the Azure Resource Manager API to update the service tier. This is a no-code / low-code solution that meets the requirement of not requiring custom scripting.

Option A is incorrect because Azure Automation runbooks require PowerShell scripts. Option B is incorrect because Elastic Database Jobs cannot change service tiers. Option D is incorrect because Azure Functions require custom code.

161
Multi-Selecteasy

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

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

Elastic Jobs can automate T-SQL index maintenance across databases.

Why this answer

Options A and D are correct. Automatic tuning can automatically create/drop indexes. Elastic Database Jobs can run custom index maintenance scripts.

Option B is wrong because SQL Agent is not available in Azure SQL Database. Option C is wrong because Automation Runbooks are for PowerShell, not T-SQL directly. Option E is wrong because Data Factory is for data movement.

162
MCQhard

Your company uses GitHub Actions to deploy changes to Azure SQL Database. You need to ensure that rollbacks can be performed automatically if a deployment fails. Which strategy should you implement?

A.Use Azure App Service deployment slots for the database
B.Use GitHub Actions deployment environments with approval gates
C.Create a database copy or snapshot before each deployment
D.Use Azure SQL Managed Instance point-in-time restore
AnswerC

A snapshot or copy can be used to restore the previous state if deployment fails.

Why this answer

Option B is correct because deploying database snapshots before changes allows point-in-time recovery and rollback. Option A is for Azure SQL Managed Instance, not Database. Option C is not a standard rollback method.

Option D is for code deployment, not database state.

163
MCQeasy

You need to automate the deployment of Azure SQL Database logical servers and databases using Bicep. What is the best practice for storing the administrative password securely?

A.Reference the password from Azure Key Vault using the getSecret function
B.Use the adminPassword property with a generated password
C.Use an environment variable in the deployment script
D.Store the password as a plain text parameter in the Bicep file
AnswerA

Key Vault integration securely retrieves secrets during deployment.

Why this answer

Option A is correct because Azure Key Vault is the recommended secure storage for secrets like administrative passwords in Azure deployments. Using the `getSecret` function in Bicep allows you to reference a secret from Key Vault at deployment time without exposing the password in the Bicep file or deployment logs, aligning with Azure security best practices and the principle of least privilege.

Exam trap

The trap here is that candidates may think environment variables or generated passwords are acceptable for automation, but the DP-300 exam specifically tests the secure secret management pattern using Azure Key Vault with Bicep's `getSecret` function, not just any method of hiding the password.

How to eliminate wrong answers

Option B is wrong because using the `adminPassword` property with a generated password, while functional, does not securely store the password; it is typically passed as a parameter and can be exposed in deployment logs or outputs. Option C is wrong because environment variables in the deployment script are not encrypted and can be captured in process dumps or logs, failing to meet security compliance requirements. Option D is wrong because storing the password as a plain text parameter in the Bicep file directly exposes the secret in source control and deployment history, violating fundamental security practices.

164
MCQmedium

Refer to the exhibit. You run the above PowerShell command to set the Transparent Data Encryption (TDE) protector for an Azure SQL Database server. What is the result?

A.The command fails because the service principal does not have permissions to the key vault.
B.Transparent Data Encryption is disabled.
C.The TDE protector for the database "mydb" is updated.
D.The server’s TDE protector is changed to a customer-managed key from Azure Key Vault.
AnswerD

The command sets the protector to a key vault key.

Why this answer

Option B is correct. The command sets the TDE protector to an Azure Key Vault key, enabling customer-managed key (CMK) for TDE. Option A is wrong because the command does not disable TDE.

Option C is wrong because it does not check key permissions. Option D is wrong because the command is for the server-level TDE protector, not for a specific database.

165
Multi-Selecthard

You are designing an automated backup strategy for Azure SQL Database. Which TWO actions satisfy a requirement to maintain daily backups for 30 days and ensure recoverability if the Azure region becomes unavailable?

Select 2 answers
A.Enable geo-redundant backup storage for the server.
B.Deploy a read-scale replica in a different Azure region.
C.Set point-in-time restore retention to 30 days.
D.Set up a long-term retention policy with a retention of 30 days.
E.Configure active geo-replication to a secondary region.
AnswersA, C

Geo-redundant backup storage (RA-GRS) replicates backups to a paired region, ensuring regional recoverability.

Why this answer

Option A is correct because enabling geo-redundant backup storage (RA-GRS) for Azure SQL Database ensures that automated backups are replicated to a paired Azure region. This satisfies the requirement for recoverability if the primary region becomes unavailable, as backups can be restored from the secondary region. Combined with setting point-in-time restore retention to 30 days (Option C), you maintain daily backups for the full 30-day retention period, meeting both requirements.

Exam trap

The trap here is confusing high-availability features (like geo-replication or read-scale replicas) with backup retention and storage redundancy, leading candidates to select options that provide failover capability but do not satisfy the backup retention or geo-redundant backup storage requirements.

166
MCQhard

A company uses Azure SQL Database with elastic pools. They need to automatically scale up the pool DTU when CPU usage exceeds 80% for 5 minutes and scale down when below 20% for 10 minutes. Which solution should they implement?

A.Use Elastic Database Transactions to handle scaling
B.Configure autoscale settings on the elastic pool in the Azure portal
C.Use Azure Automation runbook with PowerShell to check metrics and scale
D.Create a SQL Agent job to monitor and alter the pool
AnswerC

Azure Automation runbooks can use Get-AzMetric and Set-AzSqlElasticPool to implement custom autoscaling.

Why this answer

Azure SQL Database autoscale is not natively supported; scaling must be done programmatically. Azure Automation with PowerShell runbooks can query metrics and trigger scaling. SQL Agent jobs are not available in Azure SQL Database.

Elastic Database Transactions are for distributed transactions, not scaling. Azure Logic Apps can also be used but are more complex for this scenario.

167
MCQhard

You are a database administrator for a multinational corporation that uses Azure SQL Managed Instance. The instance is part of a failover group for disaster recovery. You need to automate the process of testing the failover group by performing a planned failover to the secondary region and then failing back. The test must be performed monthly during a maintenance window. The automation must ensure that the failover group is in a healthy state before and after the test and must log the results to a table. Additionally, the solution must be self-contained within the Managed Instance and not rely on external tools. What should you do?

A.Use Elastic Database Jobs to run T-SQL that initiates failover and logs results.
B.Create an Azure Automation runbook with PowerShell that uses the Az.Sql module to perform failover and log to a table.
C.Use Azure Data Factory to execute a stored procedure that performs failover.
D.Create a SQL Agent job with T-SQL that performs the planned failover using ALTER AVAILABILITY GROUP and logs the results to a table.
AnswerD

SQL Agent is available and can perform failover with T-SQL.

Why this answer

Option D is correct. SQL Agent jobs on Managed Instance can execute T-SQL commands to perform failover using the ALTER AVAILABILITY GROUP command (which is available for failover groups) and log results. Option A is incorrect because Elastic Database Jobs is not available for Managed Instance.

Option B is incorrect because Azure Automation requires external setup. Option C is incorrect because Data Factory is not for failover orchestration.

168
MCQeasy

You need to automate the backup of an Azure SQL Managed Instance to a storage account every 4 hours. Which feature should you use?

A.Built-in automated backups
B.SQL Agent jobs
C.Long-term retention (LTR) policies
D.Azure Automation with PowerShell runbooks
AnswerD

Azure Automation runbooks can schedule and execute backup commands for Azure SQL Managed Instance.

Why this answer

Long-term retention (LTR) backups are for retaining backups beyond the automated backup period, not scheduling. Azure SQL Managed Instance automated backups are built-in and cannot be customized for frequency. Azure Automation with PowerShell runbooks can invoke backups using T-SQL or REST APIs.

SQL Agent jobs cannot run on managed instance as they are not available.

169
MCQmedium

A company uses Azure SQL Database for a critical application. They need to automate the process of exporting a database to a storage account every night, ensuring the export is consistent. The solution must minimize administrative overhead. What should they use?

A.Create an Azure Automation runbook that uses the Export-AzureRmSqlDatabase cmdlet and schedule it to run nightly.
B.Create an Elastic Database Job that runs a T-SQL script to export the database.
C.Deploy an Azure Data Factory pipeline with a Copy activity to export the database.
D.Use an Azure Logic App with the SQL Server connector to export the database.
AnswerA

Azure Automation can run PowerShell scripts on a schedule; Export-AzureRmSqlDatabase exports the database as a BACPAC to Azure Storage.

Why this answer

Option A is correct because Azure Automation runbooks can execute PowerShell cmdlets like Export-AzureRmSqlDatabase (or the newer Export-AzSqlDatabase) to perform a consistent export of an Azure SQL Database to a storage account. By scheduling the runbook to run nightly, you automate the export with minimal administrative overhead, as the export operation uses database snapshots to ensure consistency without requiring complex orchestration.

Exam trap

The trap here is that candidates often overcomplicate the solution by choosing Azure Data Factory or Logic Apps, thinking they need a full ETL tool, when a simple scheduled PowerShell runbook is the most direct and low-overhead method for a consistent database export to storage.

How to eliminate wrong answers

Option B is wrong because Elastic Database Jobs are designed for executing T-SQL scripts across multiple databases (e.g., schema changes, index maintenance), not for exporting a database to a storage account; they lack native support for storage account interactions. Option C is wrong because Azure Data Factory pipelines with Copy activity can export data, but they require building a full pipeline with linked services and datasets, which introduces more administrative overhead than a simple scheduled runbook for a straightforward export task. Option D is wrong because Azure Logic Apps with the SQL Server connector can perform operations like querying or inserting data, but they do not support exporting an entire database to a storage account as a consistent backup; the connector lacks the necessary export functionality.

170
MCQeasy

You are automating the creation of an Azure SQL database. You need to ensure that the deployment is idempotent using Azure Resource Manager (ARM) templates. Which deployment mode should you use?

A.Complete
B.Automatic
C.Incremental
D.Validate
AnswerC

Incremental mode updates resources in the resource group based on the template, making it idempotent.

Why this answer

Option B is correct because 'Incremental' mode processes the template as an incremental update to the resource group, making it idempotent. 'Complete' mode deletes resources not in the template, which is not idempotent. 'Validate' mode only validates without deploying, and 'Automatic' is not a valid ARM mode.

171
MCQhard

You are the database administrator for a large e-commerce company that uses Azure SQL Database for its transactional systems. The environment consists of 100 databases spread across 10 elastic pools in different regions. You need to implement an automated solution to perform the following tasks every night: (1) Run integrity checks (DBCC CHECKDB) on all databases, (2) Rebuild indexes with fragmentation > 30%, (3) Update statistics with full scan for databases that have had significant data changes (>20% of rows). The solution must minimize manual intervention, provide centralized logging, and be resilient to failures (e.g., if one database fails, the others should continue). Which approach should you use?

A.Create an Elastic Database Job with step scripts for each maintenance task, targeting all databases, and configure retry logic.
B.Create a SQL Agent job on each server to run a maintenance script.
C.Use Azure Data Factory pipelines with a ForEach activity to execute stored procedures.
D.Use Azure Automation runbooks with Invoke-SqlCmd to loop through each database.
AnswerA

Elastic Jobs are designed for multi-database maintenance with resilience.

Why this answer

Option B is correct because Elastic Database Jobs can run T-SQL scripts across multiple databases with built-in retry and error handling, and can be scheduled. Option A (SQL Agent) is not available on Azure SQL Database. Option C (Azure Automation) requires custom error handling.

Option D (Azure Data Factory) is not designed for database maintenance tasks.

172
MCQmedium

A company uses Azure SQL Managed Instance. They need to automate index maintenance for all databases in the instance. The solution must minimize administrative overhead and use built-in Azure features. What should you do?

A.Use Azure Automation with a PowerShell runbook that connects to each database and runs index maintenance.
B.Configure a SQL Agent job on the instance to run index maintenance on the master database.
C.Create an elastic job agent with a T-SQL script for index maintenance targeting all databases.
D.Use Azure Data Factory to schedule a stored procedure execution for each database.
AnswerC

Elastic job agent is designed for automating tasks across databases in a managed instance with minimal overhead.

Why this answer

Option C is correct because an elastic job agent is a built-in Azure feature designed specifically for automating administrative tasks across multiple databases in Azure SQL Managed Instance. It allows you to create a T-SQL script for index maintenance and target all databases in the instance with minimal overhead, as it manages scheduling, retries, and target group membership natively.

Exam trap

The trap here is that candidates might confuse SQL Agent jobs (which are database-scoped in Managed Instance) with the ability to run cross-database tasks, or assume Azure Automation is the only built-in option, when in fact elastic job agents are the native, low-overhead solution for multi-database automation in Azure SQL Managed Instance.

How to eliminate wrong answers

Option A is wrong because Azure Automation with a PowerShell runbook introduces unnecessary administrative overhead and is not a built-in Azure SQL feature; it requires managing runbook accounts, modules, and authentication separately, and does not integrate natively with SQL Managed Instance's database engine. Option B is wrong because configuring a SQL Agent job on the master database only runs maintenance on that single database, not on all databases in the instance; SQL Agent jobs in Managed Instance are scoped to the database where they are created, unless explicitly targeting others via cross-database queries, which is not a built-in automation feature for all databases. Option D is wrong because Azure Data Factory is an orchestration service for data movement and transformation, not a built-in tool for automating index maintenance on SQL Managed Instance; it would require complex pipeline design and external triggers, adding overhead rather than minimizing it.

← PreviousPage 3 of 3 · 172 questions total

Ready to test yourself?

Try a timed practice session using only Automation Tasks questions.