Create a service hook for Azure DevOps Services and Team Foundation Server (TFS) with Microsoft Teams
Azure DevOps Services | TFS 2017.2
This article applies to Azure DevOps Services and to TFS 2017.2 and later versions.
See activity about your Azure DevOps Services or Team Foundation Server (2017.2 and later) projects directly in your Microsoft Teams channel, for example:
- Work item updates
- Pull requests
- Code commits
- Release deployments and approvals
Also bring your Azure DevOps Services Kanban board directly into Microsoft Teams as a tab.
While the functionality is the same across Azure DevOps Services and Team Foundation Server, the configuration process is different. Check out the appropriate getting started section below for details.
You must be a member of Project Administrators or Project Collection Administrators to configure the connector.
Configuring a new connector for Azure DevOps Services
To bring events from Azure DevOps Services into Microsoft Teams, click the ellipsis or '...' at the top nav of your team channel, and then select Connectors.
Select Azure DevOps Services from the list.
Select your organization (you may be prompted to sign in first), the project, and your team.
Choose the type of activity you want to be notified about. Depending on the event, you may be given further fields to filter down the notifications so you can filter out notifications your team does not care about. For example, for work item events, you can filter by area path, work item type, and even particular field changes.
When you are happy with the configuration, save it.
Activity from your Azure DevOps Services project will start appearing in your Teams channel.
Changing an existing connector
To make a change to an existing connector:
- Navigate to the "Configured" tab on the Connector dialog, find the connector, and click Manage.
Configuring a new connector for TFS
Configuring integration between Team Foundation Server and Teams is a two step process. First setup a connector in Teams, then setup one or more service hook subscriptions in your Team Foundation Server project.
Project administrator permissions are required to create service hook subscriptions.
To bring events from TFS into Microsoft Teams, click the ellipsis or '...' at the top nav of your team channel, and select Connectors.
Select Team Foundation Server from the list.
Choose a name for the Connector, for example "My project notifications", and click Create. Note: this name is only used for managing the Connector.
Copy the generated web hook URL. You will provide this URL when setting up service hook subscriptions in your TFS project.
From Team Foundation Server
From your TFS team project page (
https://mycompany/tfs/[collection]/[project]), navigate to Service Hooks in the settings:
Click Create subscription and select the "Teams" service.
Choose the type of activity you want to appear in your Teams channel.
You can filter each of the triggers in specific ways. For example, the pull request created trigger can be filtered on the repository in which the pull request occurs, the target branch it applies to, and the team members that are required or invited to review the request.
Paste the web hook URL from the Teams connector configuration step and click Finish.
Activity from your TFS project will start appearing in your Teams channel.
Kanban board & Dashboards in Teams (Azure DevOps Services only)
Bring in your teams kanban board or favorite dashboard directly into Microsoft Teams.
The Kanban board and Dashboard integration has the following limitations:
- Only works for Azure DevOps Services (Team Foundation Server is not supported)
- Only Kanban boards and Dashboards within organizations in the same organization (Azure Active Directory tenant) as your Microsoft Teams account can be configured.
Configuring Azure DevOps Services Tabs in Microsoft Teams
To bring your Kanban board or Dashboard into Microsoft Teams, click the '+' ('add new tab') button on the top nav of your team channel. Find the Visual Studio icon and follow the steps to connect to your organization.
Once you have authenticated and selected your organization, you will be displayed a screen to select a Kanban board or Dashboard.
Q & A
Q: How can I get multiple events from my TFS project to show up in my Teams channel?
A: Create a new subscription for each type of event you want. For example, if you want to see build failures and new work items in your Teams channel, create two additional subscriptions.
Q: I don't see my organization when trying to connect Microsoft Teams
A: Only organizations in the same Azure Active Directory tenant as your Microsoft Teams account can be connected. This means even if the sign-in email address is the same for Azure DevOps Services and Microsoft Teams, they may be backed by different tenants and therefore cannot be linked.
To resolve this you can create a new Team in the same Azure Active Directory (Azure AD) as Azure DevOps Services, or move your Azure DevOps Services to the same Azure AD as Teams (see Why is my organization already connected to a directory? Can I change that directory?.