AZ-400 Question 54
Select 2Your DevOps team uses Azure Repos for version control and wants to notify a specific Slack channel whenever a new pull request (PR) is created or updated in a particular repository. You decide to configure this integration by using a webhook through Azure DevOps Service Hooks. Which two actions must you take to successfully set up these notifications?
- A
Create a Service Hook subscription, select the 'Pull Request Created' event, and provide the Slack webhook URL for the target channel.
- B
Enable a special Slack permission for 'Project Administrators Only' to receive service hook notifications in Slack.
- C
Configure a personal access token in Azure DevOps under 'Organization Settings > Security' and paste it into the Slack channel settings.
- D
Select the 'Pull Request Updated' event for additional notifications, and specify the channel webhook or Slack integration app in the Service Hooks configuration.
Show answer and explanation
Correct answers: A, D
Explanation
In Azure DevOps, you configure Slack or other third-party integrations by creating Service Hooks that subscribe to specific events. For pull request notifications, you typically create individual subscriptions for 'Pull Request Created' and 'Pull Request Updated' events, providing Slack� webhook URL so that Azure DevOps can post automated messages. This approach follows the official Microsoft documentation on service hooks (https://learn.microsoft.com/azure/devops/service-hooks/overview).
- A. Correct.
Correct. To notify Slack about a new PR, you must create a Service Hook subscription in Azure DevOps. You configure the event type (e.g., 'Pull Request Created') and provide the Slack webhook URL so Azure DevOps can post messages to the correct channel.
- B. Incorrect.
Incorrect. Slack does not require a special 'Project Administrators Only' permission to receive service hook notifications. Instead, Slack generally uses incoming webhooks or Slack apps to receive and display these alerts.
- C. Incorrect.
Incorrect. While personal access tokens can be used for various integrations in Azure DevOps, Slack� incoming webhook notifications do not require you to configure a personal access token in Azure DevOps. You typically provide Slack's webhook URL or use a Slack app for authentication.
- D. Correct.
Correct. If you also want Slack to receive updates when a PR changes (e.g., a new commit is pushed or the PR status changes), you must configure another Service Hook subscription by selecting the 'Pull Request Updated' event. Then, specify the same Slack webhook or Slack integration app.