How do you use cloud databases? Take the survey.

Webhook notifications to Microsoft Teams? (Currently doesn't seem to work)

mrhcarlinmrhcarlin Posts: 5 New member
edited January 28, 2020 10:15AM in Redgate Monitor
So on one of my Teams channels I've added an "incoming webhook" connector and put the URL it gave me in SQL Monitor's webhook notifications setting. Now I realise that this feature is in preview, so maybe I just need to wait for it get fixed, but it doesn't work. I ruled out our proxy server being the issue by exposing the SQL Monitor server directly to the Internet, and I'm still getting 400 error codes.

Below is the error from the Base Monitor log whenever I try to send a test notification:

2020-01-28 09:19:35,396 [26] WARN  RedGate.SqlMonitor.Engine.Alerting.Base.Core.Email.WebhookNotificationSender - Error posting webhook notification
System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request)
   at System.Net.WebClient.UploadString(Uri address, String method, String data)
   at RedGate.SqlMonitor.Engine.Alerting.Base.Core.Email.JsonPoster.PostObject(String url, Object payload)
   at RedGate.SqlMonitor.Engine.Alerting.Base.Core.Email.WebhookNotificationSender.SendNotification(AlertNotification alertNotification)System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request)
   at System.Net.WebClient.UploadString(Uri address, String method, String data)
   at RedGate.SqlMonitor.Engine.Alerting.Base.Core.Email.JsonPoster.PostObject(String url, Object payload)
   at RedGate.SqlMonitor.Engine.Alerting.Base.Core.Email.WebhookNotificationSender.SendNotification(AlertNotification alertNotification)

I respect that this could also be a Teams issue, but we are actually using webhooks for other applications and they just work.

Is there anything I can do/modify, or will I have to wait for improvements to this feature?

Thanks,

Matt
Tagged:

Answers

  • Russell DRussell D Posts: 1,324 Diamond 5
    edited January 28, 2020 12:01PM
    Does passing a webhook to your Teams install require authentication?
    Have you visited our Help Centre?
  • mrhcarlinmrhcarlin Posts: 5 New member
    edited January 28, 2020 12:19PM
    Russell D said:
    Does passing a webhook to your Teams install require authentication?
    It does not, which I mainly know from having set up two other incoming webhooks to Teams.

    I'm really leaning towards the issue being that Teams can't translate the JSON payload that SQL Monitor sends. Do you know if it's possible to modify the JSON so I can tailor its layout? There's an example in the link below, but I can't find anything like it in installation directory... One of the other two webhooks that I set up required customization of the JSON, so I'm hoping that this is possible with SQL Monitor.

    https://documentation.red-gate.com/sm9/configuring-sql-monitor/setting-up-webhook-notifications-preview

  • It's not yet possible I'm afraid. We're hoping to support templating in the near future, so this should be possible but currently your suspicion is correct.
    Have you visited our Help Centre?
  • mrhcarlinmrhcarlin Posts: 5 New member
    Russell D said:
    It's not yet possible I'm afraid. We're hoping to support templating in the near future, so this should be possible but currently your suspicion is correct.
    Thanks. I'll keep an eye out for it in future releases.
  • ssh4478ssh4478 Posts: 8 Bronze 1
    Any further updates on Teams integration. As far I can see its not in preview  anymore but part of product.
    I am trying to integrate the web hook with team channels which is kind of working now but stumble upon the fact that we can't have multiple hooks for different channels ?
    Also how can we customise the channel based on the severity and type of alerts, is it all possible in line with other same monitoring tools in the market, please suggest?
    TIA
Sign In or Register to comment.