Azure DevOps Service Hooks

Azure DevOps Service hooks let you run tasks on other services when events happen in your Azure DevOps Services projects.

For example, build a CI in Azure DevOps and then start the CD on the Jenkins or we can send the notifications on the Slack channel or Teams channels if the build or deployment fails or even we can send the slack for Release approvals too.

Azure DevOps Service Hooks can also be used in custom apps and services as a more efficient way to drive activities when events happen in your projects.

Azure DevOps Service Hooks publishers define a set of eventsSubscriptions listen for the events and define actions to take based on the event. Subscriptions also target consumers, which are external services that can run their own actions, when an event occurs.

azure-devops-service-hooks-1

Create a subscription of Service Hooks:

When you integrate one of these services with Azure DevOps Services, you have to create a new subscription. In many cases, you have to do some work in the other service, too. For specific details, look at the information on the service that you’re interested in.

  1. Open the admin page for a project in web access.
azure-devops-service-hooks-2

2. Create a subscription by running the wizard.

azure-devops-service-hooks-3

3. Select the service you want to integrate with.

azure-devops-service-hooks-4

4. Select the event to trigger on and any filters (if applicable).

azure-devops-service-hooks-5

5. Select an action to run on the target service.

Note: The list of available actions may be limited based on the event type you selected.

azure-devops-service-hooks-6

6. To confirm the settings are correct, test the subscription and then finish the wizard.

azure-devops-service-hooks-7
azure-devops-service-hooks-8

Once after this is setup the service hooks will be always triggered when ever the specific actions are hit upon . We can see that on the logs on the service hooks location itself , like how many times it has been triggered.

azure-devops-service-hooks-9

Now, we can see how to Release approvals are sent to the Slack channels so that the required people can approve it accordingly.

  1. Go to the Service Hooks from the General project settings.
  2. Choose the provider as Slack from the below menu.
devops-service-hooks-10

3. Choose Next and then choose which action we need to perform.

devops-service-hooks-11

4. In the next step we need to give the Slack Hooks that we prepared from the Slack channel.

devops-service-hooks-12

5. Click on the Test to check if we have setup everything correctly and we can see the test message from the slack channel as well.

devops-service-hooks-13
devops-service-hooks-14

6. Now our test webhook is working perfectly. So we can setup the alerts and save it.

devops-service-hooks-15

7. Now , we can go to the Release description and then start a deployment to check if we are getting the original approval.

devops-service-hooks-16

8. Now we can see the slack getting the approvals and then from this slack we can go to the pipeline and then login to Azure DevOps to approve it.

azure-devops-pipeline-17

Recommended Courses

VILT & Self-Paced
Azure Developer Certification

AZ-204: Developing Solutions for Microsoft Azure

This self-paced course will help you prepare for the Azure Developer certification exam AZ-204: Developing Solutions for Microsoft Azure.

BUY NOW

Self-Paced
Azure Developer Certification

AZ-900: Microsoft Azure Fundamentals Tutorial

AZ-900: Microsoft Azure Fundamentals Tutorial provides foundational level knowledge on cloud concepts; core Azure services; security, privacy, compliance, and trust; and Azure pricing and support.

BUY NOW

Self-Paced
Azure DevOps Online Course

AZ-400: Designing and Implementing Microsoft DevOps Solutions

This self-paced course will help you prepare for the Azure DevOps certification exam AZ-400: Designing and Implementing Microsoft DevOps Solutions.

BUY NOW


For further queries related to Azure DevOps training, contact us

Sharing is Caring

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top