Tuesday, 26 July 2016

Visual Studio Online Service Hooks

Visual Studio Online provides a nifty feature called "Service Hooks". It is a great way to integrate your Visual Studio Online set up with external services like Slack, Bamboo, custom Web Hooks etc.

You can set it up by clicking the settings icon on the .visualstudio.com. It redirects to the administration portal where you see the tab "Service Hooks".



You would notice a plethora of options to integrate with. Some are well known third party services, some are azure's queue offerings (Azure Storage Queue, Azure Service Bus: Notification Hub, Topic, Queue), and the likes.

You can pick the events that needs to be integrated with the external end point e.g. Build Completed, Check-in Completed etc.



On the next screen, you see options specific to the external system selected on first screen. For example - if you pick Azure Service Bus, you get to provide following details:


And you are set.


I set up the service hook against a check-in event. As soon as a check-in completes, we notice a message in the azure service bus topic.



And if you are wondering what happens when you delete the topic or provide wrong azure service bus details, it is not that drastic. As you would expect, it fails in a safe manner and you can see a detailed log of the failure so that you can correct it.






No comments:

Post a Comment