Webhook notifications to Microsoft Teams? (Currently doesn't seem to work)
mrhcarlin
Posts: 5 New member
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:
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
Is there anything I can do/modify, or will I have to wait for improvements to this feature?
Thanks,
Matt
Tagged:
Answers
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
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