Courseiva
Design and implement a source control strategymediumMultiple ChoiceObjective-mapped

Using the Microsoft Teams Notification Task on Pipeline Failure

Exhibit

Refer to the exhibit.
```json
{
  "status": "completed",
  "result": "failed",
  "ref": "refs/heads/feature/logging",
  "repository": {
    "name": "myapp",
    "url": "https://dev.azure.com/myorg/myapp/_apis/git/repositories/myapp"
  },
  "pipeline": {
    "name": "CI Pipeline",
    "id": 123
  }
}
```

You receive a webhook notification from Azure Pipelines with the above payload. The build for the 'feature/logging' branch failed. You want to automatically create a work item to track the fix. What should you configure in Azure DevOps?

Quick Answer

The 'Create work item on failure' pipeline setting automatically opens a work item in Azure Boards whenever a run fails — turning on this built-in option for the pipeline tracking feature/logging directly meets the requirement to track the fix without any external integration or manual step.

⚠ Common exam trap

The trap here is that candidates may overcomplicate the solution by choosing a manual or external integration (like service hooks or GitHub Actions) when Azure Pipelines already provides a simple, built-in configuration option for automatic work item creation on failure.

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

Enable the 'Create work item on failure' option in the pipeline settings.

Azure Pipelines provides a built-in setting called 'Create work item on failure' that automatically generates a work item (e.g., a bug or task) in Azure Boards whenever a pipeline run fails. This directly meets the requirement to track the fix for the failed build on the 'feature/logging' branch without requiring external integrations or manual steps.

Answer analysis

Option-by-option breakdown

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

  • Add a branch policy on 'feature/logging' to require a successful build before merging.

    Why it's wrong here

    Policy does not create work items.

  • Enable the 'Create work item on failure' option in the pipeline settings.

    Why this is correct

    Automatically creates a work item when a build fails.

  • Use a GitHub Actions workflow to create an issue on failure.

    Why it's wrong here

    GitHub Actions is for GitHub, not Azure Repos.

  • Create a service hook subscription to listen for build failures and call Azure Boards API.

    Why it's wrong here

    Possible but not the simplest option.

About these practice questions

One of 823 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on AZ-400

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Your team uses Azure DevOps and wants to automate the creation of work items when a build pipeline fails. The work item should be assigned to the last person who committed a change in the failed build. Which approach should you use?

medium
  • A.Create a release pipeline that triggers on build failure and creates a work item.
  • B.Add the 'Create work item on failure' task to the build pipeline.
  • C.Configure a Service Hook to create a work item on build failure.
  • D.Use a PowerShell script in the pipeline to call Azure DevOps REST API.

Why B: The 'Create work item on failure' task in Azure DevOps build pipelines automatically creates a bug work item and assigns it to the last committer of the failed build. Option A is incorrect because release pipelines are meant for deployment, not build-time tasks. Option C is incorrect because while Service Hooks can trigger on build failure, they require additional custom logic to assign the work item to the last committer, making it less straightforward. Option D is incorrect because using a PowerShell script to call the REST API is more complex and error-prone compared to the built-in task.

Variation 2. Your team uses Azure DevOps and wants to automate the creation of a bug work item when a release pipeline fails. Which two actions should you take?

easy
  • A.Set a scheduled trigger for the release pipeline.
  • B.Configure a Service Hook to create a work item when a release stage fails.
  • C.Add a build completion trigger to the release pipeline.
  • D.Add the 'Create work item on failure' task to the release pipeline.
  • E.Configure a pre-deployment approval.

Why B: Service Hooks are a valid method to create a work item on release failure. However, the built-in task is called 'Create Work Item', not 'Create Work Item on Failure'. To achieve the desired automation, you would add a 'Create Work Item' task and set its Control Options to run only when a previous task fails. Since option D incorrectly names the task, it is not correct. The question asks for two actions, but among the given options, only B is a valid action. Therefore, the question is flawed because there is no second correct option.

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.