1
votes

I am trying to understand the difference between Service Hooks and Service Connections in Azure DevOps. Service Hooks and Service Connections both seem to do the same thing according to these description.

"Service connections enable you to connect to external and remote services to execute tasks in a job." Service Connections

"Service hooks let you run tasks on other services when events happen in your Azure DevOps projects." Service Hooks None of these pages tell the reader the difference between service hooks and service connections. Even though I am sure each is used for a different purpose.

1

1 Answers

3
votes

Service connections enable you to connect to external and remote services to execute tasks in a Azure pipeline job. For example, you may need to connect to your Microsoft Azure subscription, to a different build server or file server, to an online continuous integration environment, or to services you install on remote computers.

You could go to Project Settings>>Service connections page to see available service connections. And when you use tasks which required to connect to external and remote services, you will see it requires you to set up corresponding service connection. For example, if you use GitHub repository as the source repository in pipeline, you need to set up GitHub service connection.

In the meanwhile, Service hooks let you run tasks on other services when events happen in your Azure DevOps projects. You could go to Project Settings>>Service hooks page to integrate with your favorite services by notifying them when events happen in your project. For example, create a card in Trello when a work item is created or send a push notification to your team's mobile devices when a build fails.

You can also use service hooks in custom apps and services as a more efficient way to drive activities when events happen in your projects. Also you could create a service hook for Azure DevOps with Microsoft Teams, so members can get notified when builds are completed, work item updated, etc.