Microsoft DevOps Engineer Expert AZ-400 Practice Question
You need to define a branching and deployment strategy for a GitHub repository that hosts an enterprise-wide Node.js microservice. The requirements are:
The 'main' branch must always contain code that is ready to be promoted to production.
New work should be isolated without blocking other teams.
Code reviews and automated tests must run before the code is merged.
The repository's history should stay linear and easy to trace. Which approach satisfies these requirements and follows GitHub Flow principles?
Commit directly to 'main', tag a semantic version when ready, and trigger the release pipeline from the tag without using pull requests or CI checks.
Create environment branches named 'dev', 'stage', and 'prod'; merge pull requests sequentially between them to promote releases while allowing direct pushes to 'dev' for urgent fixes.
Create short-lived topic branches from 'main', open a pull request that requires at least one approving review and a passing CI workflow, then squash and merge the pull request back into 'main', triggering an automated deployment pipeline.
Maintain a persistent 'development' branch where all features are merged. Once a sprint ends, create a pull request from 'development' to 'main' and deploy after manual testing.
GitHub Flow prescribes creating a short-lived branch from 'main' for every piece of work, pushing commits to that branch, and opening a pull request. The pull request triggers CI, enforces at least one approving review, and, after all checks pass, is merged back into 'main'. Using the squash and merge method keeps a linear history, and an automated pipeline can deploy 'main' on every successful merge. Having long-lived environment branches, promoting changes between multiple stable branches, or committing directly to 'main' violate GitHub Flow because they either lengthen branch life, bypass reviews/tests, or fragment the single source of truth.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why is squash and merge used in GitHub Flow?
Open an interactive chat with Bash
What are CI workflows in the context of GitHub Flow?
Open an interactive chat with Bash
Why does GitHub Flow prefer short-lived branches instead of environment branches?
Open an interactive chat with Bash
Microsoft DevOps Engineer Expert AZ-400
Design and implement processes and communications
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .