Microsoft DevOps Engineer Expert AZ-400 Practice Question
Your organization mandates that every production deployment undergo an automated Azure Policy compliance scan before any resources are updated. You have a multi-stage YAML pipeline that deploys to an environment named prod. You must block the deployment until the scan succeeds, without editing any pipeline stages or jobs. What should you do?
Add an Azure Policy compliance check to the prod environment's approvals and checks in Azure DevOps.
Configure a branch protection rule that requires an external status check for Azure Policy on the main branch.
Add a ManualValidation task to the deployment stage and assign the security team as approvers.
Insert an AzurePowerShell task in the deployment job to query policy state before continuing.
Azure DevOps environments support "approvals and checks" that run before a deployment job in a stage can start. The built-in Azure Policy compliance check (AzurePolicyCheck) evaluates the target subscription or resource group against assigned policies and blocks the deployment until the scan passes. Adding this check to the prod environment enforces the gate independently of the pipeline YAML. Executing a script inside the job runs after resources are already created and cannot halt the stage in advance. Branch protection rules apply to repository merges, not runtime deployment governance. A ManualValidation task pauses the job for human approval, not automated policy evaluation.
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.
What is an Azure Policy compliance check?
Open an interactive chat with Bash
How do 'approvals and checks' in Azure DevOps environments work?
Open an interactive chat with Bash
Why is adding an Azure Policy compliance check better than using an AzurePowerShell task for this scenario?
Open an interactive chat with Bash
Microsoft DevOps Engineer Expert AZ-400
Design and implement build and release pipelines
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 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .