Forum Discussion

saisanthosh934's avatar
saisanthosh934
Copper Contributor
Nov 16, 2023

Webhook Messages are not delivering New Relic Notifications

We integrated New Relic Notifications to Teams Via Webhook and the notifications started failing randomly with error  "Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 400 with ContextId 01=2"

 

The notifications are failing randomly whenever a new alert is in activated state . No notifications are failing when the state is changed to closed. 

JSON Payload : 
 

 

{
    "type":"message",
    "attachments":[
       {
          "contentType":"application/vnd.microsoft.card.adaptive",
          "contentUrl": null,
          "content":{
             "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
             "type":"AdaptiveCard",
             "$data":{
              "age" : "17"
             },
             "version":"1.6",
             "body":[
                {
                  "type": "Container",
                  "items": [
                    {
                      "type": "TextBlock",
                      "size": "Large",
                      "weight": "Bolder",
                      "wrap" : true,
                      "text": {{ json priority }},
                      "color": "Attention"
                    },
                    {
                      "type": "TextBlock",
                      "weight": "Bolder",
                      "text": {{ json annotations.title.[0] }},
                      "wrap": true
                    },
                    {
                      "type": "FactSet",
                      "facts": [
                        {
                          "title": "Alert State",
                          "value": {{ json state }}
                        }
                      ]
                    },
                    {
                      "type": "Image",
                      "url": {{json violationChartUrl}},
                      "altText" : "Image missing",
                      "style" : "default"
                      
                    },
                    {
                      "type": "FactSet",
                      "facts": [
                        {
                          "title": "Incidents",
                          "value": {{json totalIncidents}}
                        },
                        {
                          "title": "Impacted Entity",
                          "value": {{json entitiesData.names.[0] }}
                        },
                        {
                          "title": "Condition",
                          "value": {{ json accumulations.conditionName.[0] }}
                        },
                        {
                          "title": "Policy",
                          "value": {{ json accumulations.policyName.[0] }}
                        }
                      ]
                    }
                    
                  ]
                }
              ],
              "actions": [
                {
                  "type": "Action.OpenUrl",
                  "title": "Open Alert",
                  "url": {{ json issuePageUrl }}
                }
              ]
          }
       }
    ]
}

 

    • saisanthosh934's avatar
      saisanthosh934
      Copper Contributor

      Prasad_Das-MSFT 

       

      It is not happening continuously and happening randomly . Below is the screenshot from new relic regarding the notification failure 

      • Prasad_Das-MSFT's avatar
        Prasad_Das-MSFT
        Icon for Microsoft rankMicrosoft

        saisanthosh934 - Could you please share the tenant details and network log along with the time stamp when the request if failing, so that we can investigate further?

Resources