Forum Discussion

torumakabe's avatar
torumakabe
Icon for Microsoft rankMicrosoft
Nov 13, 2017

Unwanted backslash in alert webhook

Hi there, I have a problem about alert webhook integration with slack.

 

My query of alert is the following

```

AzureActivity | where OperationName == "Update resource group" and ActivityStatus == "Succeeded"

```

 

And my JSON payload of webhook is here

```

{"text":"#A new resource group has been created. You can find the detail from <#linktosearchresults|OMS Search Results>"}

```

 

Then I got a webhook on my slack client and click the link defined "#linktosearchresults" to confirm the alert. But the query failed because there were some unwanted escape backslash in the query generated the link.

```

AzureActivity | where OperationName == \"Update resource group\" and ActivityStatus == \"Succeeded\"

```

 

Does anyone know the cause and the workaround?

2 Replies

Resources