I have discovered Microsoft Teams and I like it. I am now trying to trigger pullrequest messages from TFS to Microsoft Teams. I have a Teams Group webhook url that works fine with curl. But when I test it with TFS (Service Hooks -> Web Hooks) then I only get bad requests. Do any of you have an idea why that could be?
Microsoft Teams webhook on TFS
5.3k views Asked by GENiALi At
2
There are 2 answers
2

Maybe you figure it out by now cause obviously the question was asked 3 years ago, but I wanted to post my answer in order to help other people in the future.
There actually a way to hook TFS with Microsoft Teams yay!!
From TFS go to Service Hooks --> office 365 instead of (Service Hooks -> Web Hooks) because "Microsoft teams" is part of the suite 365 and as easy as that :).
PS: Of course you need to create a channel on Teams first, then click on the 3 dots --> Connectors --> Incoming Webhooks(configure) --> give your hook a name --> Create. And you're done; just copy the link generated by Teams and past it in TFS when u're asked for it ;)
If you are using VSTS, you could directly use the Connectors in Microsoft Teams to achieve what you need.
Add Visual Studio Team Service
Add related configuration such as blow picture
Create a pull request in related VSTS project, will get a message in Microsoft Teams
If you are using TFS, there is no related add-in for now. Seems you are using Incoming Webhook connector .
For Incoming Webhook, it's only support posts cards. More details about how that card is built, please refer this link: Actionable Messages Reference.
However, for Web Hooks in TFS, the sent JSON representation is not using the "card type". The sample JSON looks like below:
So you will get a fail message with bag request(400).