Project Webhook not working for Microsoft Teams


(Andy) #1

Hi I am trying to get a notification to appear in a Microsoft Teams channel. I have configured the webhook in that MS Teams channel and added it in our SonarQube project via the Project>Administration>General>Webhooks page.

I was expecting something to appear in that Teams channel after the project has been analyzed, but nothing ever appears.

I can however use that very same webhook URL to POST directly from Postman and that works OK.

I guess I have missed some configuration, but I am not seeing anything obvious. Hoping someone can offer some guidance :slight_smile:

We are using sonarQube v6.4.

(Colin Mueller) #2

Hey Andy,

Please note that the current supported versions of SonarQube are our 6.7 LTS and 7.4 Latest (the latter of which has a really cool console dedicated to webhook deliveries, etc.). You will have a hard time finding good support for versions earlier than that and should upgrade at your earliest convenience (or sooner!).

We don’t expose anything in the UI related to webhook deliveries prior to 7.1, but you can go to to see if maybe you’re getting an auth error, etc.


(Andy) #3

Hi Colin,

Thank you for the info on the API. I have just run that in postman and can see that each entry in the results has: success:false
httpStatus: 400

Nothing else to note, but I can’t really determine from that what the actually issue is with it. The url of the webhook is definitely valid though…

Also, thanks for informing me of the latest supported versions, especially with regard to the console. That sounds like it could be very useful. Will try and find some reading on that so I can see what it can do for us.

(Colin Mueller) #4

A 400 error usually indicates the payload is not in the format expected by the receiver.

(Andy) #5

Indeed, so I have tried taking the json code from Sonar Webhooks page and sent that using postman and my teams channel webhook. I also see the 400 error there.

When I post to Teams channel via my web application, I use a correctly formatted messageCard (json) and that works OK.

Currently, I am just interogatting the Sonar WebAPI to gather the information I want to send to my Teams channel which is fine, but was just interested to see what SonarQube would POST directly after a project has been analyzed :slight_smile: