Microsoft DevOps Engineer Expert AZ-400 Practice Question
You maintain an Azure DevOps YAML pipeline that runs on Microsoft-hosted Ubuntu agents. During the test stage you execute dotnet test for a solution that uses xUnit. The build must satisfy the following requirements:
If any tests fail, the job must stop and be marked failed.
A 'Tests' tab must appear in the pipeline run with detailed results that include pass/fail status for each test case.
You must not introduce any additional build tools or extensions.
Which set of two tasks should you add immediately after the build step to meet the requirements with the smallest footprint?
A Bash script that runs dotnet test and pipes the output to the console, with no additional tasks.
A single DotNetCoreCLI task with command test and no additional arguments, relying on its default behavior.
A VisualStudioTest@2 task configured for test assemblies **\*test*.dll, followed by a PublishTestResults@2 task.
A DotNetCoreCLI task with command set to test and arguments --logger trx, followed by a PublishTestResults@2 task that points to **/*.trx.
The DotNetCoreCLI task can invoke dotnet test and automatically create a *.trx file when you pass the --logger trx argument. The PublishTestResults task then consumes that *.trx output and publishes a test run that is surfaced on the Tests tab of the pipeline. Because dotnet test returns a non-zero exit code when any test fails, the job automatically fails without extra scripting. Visual Studio Test is limited to Windows agents, while the Bash sample does not generate a file format that Azure DevOps can publish. Relying on the DotNetCoreCLI task alone would not publish results unless a separate Publish Test Results task is used or the built-in publishing option is enabled.
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 does the '--logger trx' argument do in the DotNetCoreCLI task?
Open an interactive chat with Bash
How does the PublishTestResults@2 task work in Azure DevOps pipelines?
Open an interactive chat with Bash
Why is the VisualStudioTest@2 task unsuitable for this pipeline setup?
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 .