mediumMultiple ChoiceObjective-mapped
AZ-400 A company uses Azure DevOps for CI/CD Practice Question
A company uses Azure DevOps for CI/CD. They have a multi-stage YAML pipeline that builds a Java application, runs unit tests, and deploys to a test environment. The test environment uses an Azure SQL Database. The pipeline currently runs successfully but the team notices that the test database schema is not always up-to-date. They want to apply database migrations automatically as part of the pipeline. Which tool or task should they integrate?
⚠ Common exam trap
Test-takers frequently think any SQL execution task (like SQLCMD or the Azure SQL task) is sufficient for schema updates, overlooking the critical need for version control, state tracking, and repeatability that dedicated migration tools provide.
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
✓
Integrate Flyway or similar database migration tool in the pipeline.
Flyway is a dedicated database migration tool that integrates seamlessly with Azure DevOps pipelines, allowing you to version-control and apply schema changes automatically. Unlike ad-hoc scripts, Flyway tracks which migrations have been applied, ensuring the test database schema is always up-to-date without manual intervention.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use the Azure SQL Database deployment task to run a SQL script manually.
Why it's wrong here
The Azure SQL Database deployment task can execute a SQL script, but doing so manually means the script is not tied to a versioned migration history or source-controlled release process. This approach is error-prone and lacks automated, consistent deployment across environments, since each schema change must be run by hand rather than being applied deterministically as part of the pipeline.
- ✗
Use Azure SQL Database backup and restore to update the schema.
Why it's wrong here
Backup and restore is designed for disaster recovery and database cloning, not for applying incremental schema changes. Restoring a backup would overwrite the entire database and ignore the need to transition an existing schema from one version to the next, making it impossible to safely evolve a database in CI/CD without data loss or manual rework.
- ✗
Add a PowerShell task that runs SQLCMD.
Why it's wrong here
While a PowerShell task using SQLCMD can execute a SQL script, it provides no built-in migration versioning, no tracking of applied changes, and no rollback or consistency validation. This makes it difficult to manage progressive schema updates across environments, as there is no automated way to know which migrations have already run or to ensure they are applied in the correct order.
- ✓
Integrate Flyway or similar database migration tool in the pipeline.
Why this is correct
Integrating Flyway or a similar database migration tool gives the pipeline a versioned, repeatable way to manage schema changes. Flyway tracks applied migrations in a metadata table, applies scripts in order, and supports incremental upgrades and rollback, ensuring the database schema is synchronized with application code automatically as part of CI/CD.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Pipeline
A pipeline is an automated series of steps that takes code from development to production, ensuring quality and speed.
Key term
Task
A Task in Azure DevOps is a predefined, reusable step that performs a specific action during a build or release pipeline, like compiling code or running tests.
About these practice questions
Courseiva writes every AZ-400 question from scratch — 823 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 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 AZ-400 exam.