Muokkaa

Jaa


Integrate with service hooks

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Service Hooks let you run tasks on other services when events happen in your project in Azure DevOps.

For example, you can create a card in Trello when a work item gets 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.

How do service hooks work?

Service hook publishers define a set of events that you can subscribe to. Subscriptions listen for these 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 events occur.

Diagram of service hooks.

Note

Service hooks require allowing IP ranges for inbound connection to service endpoints. The service endpoint is the set of properties provided to a service hook. For more information, see Allowed address lists and network connections, IP addresses and range restrictions.

Available services

The following services are available as the target of service hooks. For more information about other apps and services that integrate with Azure DevOps, go to the Visual Studio Marketplace.

Service Supported events Supported actions
App Center Work item updated Send notification. Subscriptions are managed through App Center.
AppVeyor Code pushed Trigger an AppVeyor build. Subscriptions are managed through AppVeyor.
Azuqua All Post event to FLO. Subscriptions are managed through Azuqua.
Azure App Service Code pushed Deploy web app. Subscriptions are managed through Azure App Service.
Azure Service Bus All Send a message to a Notification Hub, Service Bus Queue, or Service Bus Topic. Subscription is managed through Azure App Service.
Azure Storage All Insert a message in a Storage Queue.
Bamboo Build completed, Code pushed Queue a build.
Datadog All Post an event in Datadog.
Grafana Release deployment completed Add annotation to Grafana database.
Jenkins Build completed, code pushed, PR merge attempted, release deployment completed Trigger generic or Git build.
Microsoft Teams All Post a message to a channel. Subscriptions are managed in Microsoft Teams.
MyGet Build completed, code pushed Publish NuGet package to MyGet. Trigger a MyGet build. Subscriptions are managed by MyGet.
Office 365 All Post a message to a group.
Slack All Post a message to a channel.
Trello All Create a card or list.
UserVoice Work item created, work item updated Send linked work item event. Subscriptions are managed through UserVoice.
Web Hooks All Post via HTTP.
Workplace Message Apps All Send notifications. Subscriptions are managed through Workplace Message Apps.
Zapier All Send notification. Subscriptions are managed through Zapier.
Zendesk Work item commented on Create a private comment in a ticket.
Service Supported events Supported actions
Azure Service Bus All Send a message to a Notification Hub, Service Bus Queue, or Service Bus Topic. Subscription is managed through Azure App Service.
Azure Storage All Insert a message in a Storage Queue.
Bamboo Build completed, Code pushed Queue a build.
Datadog All Post an event in Datadog.
Grafana Release deployment completed Add annotation to Grafana database.
Jenkins Build completed, code pushed, PR merge attempted, release deployment completed Trigger generic or Git build.
Microsoft Teams All Post a message to a channel. Subscriptions are managed in Microsoft Teams.
Office 365 All Post a message to a group.
Slack All Post a message to a channel.
Trello All Create a card or list.
[UserVoice]((https://www.uservoice.com) Work item created, work item updated Send linked work item event. Subscriptions are managed through UserVoice.
Web Hooks All Post via HTTP.
Zendesk Work item commented on Create a private comment in a ticket.

Create a subscription

When you integrate one of these services with Azure DevOps, you must create a new subscription. In many cases, you need to do some configuration in the other service, too. For specific details, check out the information for the service that you're interested in.

  1. Open the admin page for a project in web access.

    Screenshot of highlighted Project settings button.
  2. Run the wizard to create the subscription.

    Screenshot of highlighted button, Create subscription.

  3. Select the service that you want to integrate with.

    Select the service to integrate

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

    Select the event to trigger on and any filters

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

    Note

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

    Screenshot showing selection of an action for the target service.

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

    Screenshot showing test notification 1.

    Screenshot showing test notification 2.

FAQs

Q: What permissions do I need to set up a subscription?

A: Edit subscriptions and View subscriptions. By default, only project administrators have these permissions. To grant them to other users directly, you can use the command line tool or the Security REST API.

To grant View permission for a group, see Set View permission for a group in Service Hooks page.

Q: What are the security implications of granting Edit subscriptions and View subscriptions permissions?

A: The user with these permissions can see all subscriptions created in the project and the notification history for those subscriptions. That user can then create any type of service hook subscription in that project. If the user sets up a subscription for a resource that they don't otherwise have permission to access, the subscription won't be triggered.

For example: Subscriptions you create for work item update events in area path XYZ won't send notifications if you lack access to those work items. However, you can see the notification history of other users who do have access to those work items.

Q: Can I create service hook subscriptions for a project programmatically?

A: Yes. For more information, see Create a service hooks subscription.

Q: Can I remove an app's access to my organization after I've authorized it?

A: Yes. You can revoke authorizations from your profile.

  1. Go to your profile page from https://visualstudio.microsoft.com/.

    Make sure you start from the Visual Studio site (https://visualstudio.microsoft.com/) instead of your organization (https://dev.azure.com/{orgName}) because your profile accessed from your organization takes you to the wrong implementation of the authorizations management feature.

  2. Manage your authorizations.

    Screenshot showing highlighted Manage applications button.

  3. Revoke any authorizations you no longer want to allow.

    Screenshot showing Revoke option for authorizations.

Q: Why can't we set up service hooks for HipChat anymore?

A: Atlassian officially dropped support for HipChat. For more information, see the announcement.