AZ-400 Question 291
Select 2You are managing a GitHub repository that hosts your application source code and uses Azure Pipelines for continuous integration and deployment. You want your team to receive email notifications when a GitHub Actions workflow fails to pass required checks, as well as when the Azure Pipeline build encounters errors. Which two actions should you take to configure these notifications correctly?
- A
Enable GitHub Actions notifications under GitHub repository settings and set up Azure Pipeline notifications in the Pipeline settings in Azure DevOps
- B
Create a web service hook in Azure DevOps pointing to GitHub Actions to notify on any pull request update
- C
Add a custom PowerShell script in the GitHub Actions workflow file to directly send SMTP mail upon workflow failure
- D
Enable email alerts by configuring service hooks in GitHub for workflow failure events and email subscriptions for the build pipeline in Azure DevOps
Show answer and explanation
Correct answers: A, D
Explanation
In GitHub, you can configure notifications at the repository level by enabling alerts for various events such as workflow failures and pull request checks. In Azure DevOps, under Project Settings > Notifications (or previously known as Service Hooks and Subscriptions), you can create email alerts that trigger on build or release pipeline events. Refer to the Microsoft documentation on configuring notifications in Azure DevOps (docs.microsoft.com/azure/devops/notifications) and GitHub� repository settings for best practices in setting up these alerts.
- A. Correct.
Correct. GitHub provides native notifications for various events, including workflow failures, which you can enable in your repository settings. Similarly, Azure DevOps offers 'Pipeline notifications' under Project Settings to alert team members about pipeline failures or successes. Configuring both ensures you receive alerts from each platform as intended.
- B. Incorrect.
Incorrect. While Azure DevOps can integrate with GitHub in several ways, web service hooks typically go from GitHub to Azure DevOps (or another external service). Creating a hook in Azure DevOps pointing to GitHub Actions is not the standard approach for receiving GitHub workflow alerts.
- C. Incorrect.
Incorrect. Although you could write a script to send emails upon failure, this is not the recommended solution. GitHub has built-in notifications and integrations that handle this automatically without requiring manual SMTP scripting in the workflow.
- D. Correct.
Correct. For GitHub, you would configure a service hook or repository notification setting that triggers alerts for workflow failure events. In Azure DevOps, you can set email subscriptions to notify specific contributors or teams if the build pipeline fails.