Courseiva

DP-300 Configure and manage automation of tasks Practice Question

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?

⚠ Common exam trap

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

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Create an ARM template that defines both the server firewall rule and the database.

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

Answer analysis

Option-by-option breakdown

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

  • ✓

    Create an ARM template that defines both the server firewall rule and the database.

    Why this is correct

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

  • ✗

    Write a PowerShell script that uses New-AzSqlDatabase and New-AzSqlServerFirewallRule.

    Why it's wrong here

    Imperative PowerShell cmdlets execute immediately against the live subscription, so the deployment cannot be re-run idempotently or diffed as a version-controlled template. It is tempting because New-AzSqlDatabase and New-AzSqlServerFirewallRule do create both resources, and would be correct for one-off scripting tasks where no declarative repeatability is required.

  • ✗

    Use the Azure portal to create the database and firewall rule.

    Why it's wrong here

    Portal clicks produce no version-controlled artefact and cannot be replayed consistently, so the deployment is neither repeatable nor auditable. It is tempting because the portal is the fastest way to create a database and firewall rule interactively, and would be correct for exploratory or single-instance provisioning where automation is not a requirement.

  • ✗

    Use SQL Server Management Studio to script the creation.

    Why it's wrong here

    SSMS generates T-SQL scripts manually, so nothing enforces repeatability or version control across environments; the script is a one-off artefact. It is tempting because SSMS scripting is the traditional DBA approach for capturing existing object definitions, and would suit ad-hoc migration of an already-deployed database rather than declarative provisioning.

About these practice questions

Courseiva writes every DP-300 question from scratch — 574 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Microsoft exam blueprint

This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.