cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
786
Views
2
Helpful
1
Comments
maucabal
Cisco Employee
Cisco Employee

Note: This article is intended to be an alternate companion piece to the video on the same subject located here.

In July of this year, Microsoft announced that they would be retiring support for Office 365 connectors within MS Teams before the end of the year; this will render all external connectors, including incoming webhooks, basically useless.

In their place, Microsoft expects its customers to use what they call ‘Workflows’, which is nothing more than instances of Microsoft’s Power Automate running behind the scenes.

This article will cover how to properly configure MS Teams for alert notifications using ThousandEyes.

Step 0: Pre-requisites

  1. A ThousandEyes account with an admin role in order to create an integration.
  2. A Microsoft 365 account with a PowerAutomate license and access to an MS Teams tenant.

Step 1: MS Teams Configuration

  1. Log in to the MS Teams app.
  2. Navigate to the Teams section
  3. Create or navigate to your target Team’s channel.
  4. Click on the ‘...’ button in the upper-right corner and select ‘Workflows’.
  5. Select ‘Post to a channel when a webhook request is received’.

Mauro Step 1.4.png

6. Wait for the context window to load, change the workflow name (if desired) and click ‘Next’.

Mauro Step 1.6.png

7. Wait a few seconds for the context window to load again, confirm you have selected the correct Team and target channel, click ‘Add workflow.

Mauro Step 1.7.png

8. Wait another few seconds for the confirmation message and copy the generated URL for use in the next step.

Mauro Step 1.8.png

Step 2: URL Encoding

  1. Paste the recently generated URL into a notepad. 
  2. Review the URL and replace the ‘%2F’ values in the URL’s ‘sp’ parameters with ‘/’. Example: ‘%2Ftriggers%2Fmanual%2Frun’ becomes ‘/triggers/manual/run’ (bold emphasis added for visual clarity).

Mauro Step 2.png

Step 3: ThousandEyes Configuration

  1. Log in to the ThousandEyes platform.
  2. Navigate to the Integrations section.
  3. Select the ‘+ New integration’ and then ‘Custom Webhook’.

Mauro Step 3.3.pngMauro step 3.3.2.png

4. Give your new integration a name. Pro-tip: Keep the name simple! 

5. Fill the URL field with the modified URL from Step 2.

6. Select ‘Microsoft Teams’ in the ‘Preset Configurations’ drop-down menu.

Mauro Step 3.4 - 3.6.png

7. Override the ‘body’ field with the following:

{
	"type":"message",
	"attachments":[
   	{
      	"contentType":"application/vnd.microsoft.card.adaptive",
      	"contentUrl":null,
      	"content":{
         	"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
         	"type":"AdaptiveCard",
         	"version":"1.2",
         	"description":"",
         	"body":[
            	{
                	"type": "Container",
                	"items": [
                    	{
                    	"type": "TextBlock",
                    	"text": "ThousandEyes Alert Notification",
                    	"weight": "bolder",
                    	"size": "large"
                    	}
                	]
            	},
                    	{
                	"type": "ColumnSet",
                	"columns": [
                    	{
                    	"type": "Column",
                    	"width": "auto",
                    	"items": [
                        	{
                        	"type": "Image",
                        	"url": "https://app.thousandeyes.com/static/images/logo_128x128.png",
                        	"size": "medium"
                        	}
                    	]
                    	}
                 	]
                	},
                	{
                    	"type": "TextBlock",
                    	"text": "Alert{{#eq type.id 2}} Triggered{{else}} Cleared{{/eq}}{{#if alert.test}} for {{alert.test.name}}{{/if}}",
                    	"weight": "normal",
                    	"size": "large"
                    	},
                   
                    	{
                	"type": "FactSet",
                	"facts": [{
                    	"title": "Alert ID",
                    	"value": "{{alert.id}}"
                	}, {{#if alert.test}} {
                    	"title": "Test Name",
                    	"value": "{{alert.test.name}}"
                	}, {{/if}} {{#if alert.test}} {
                    	"title": "Domain",
                    	"value": "{{#each alert.targets}}{{description}}{{#unless @last}}, {{/unless}}{{/each}}"
                	}, {{/if}} {
                    	"title": "Alert Rule",
                    	"value": "{{alert.rule.name}} - {{formatExpression alert.rule.expression}}"
                	}, {{#if alert.details}} {
                    	"title": "Details",
                    	"value": "{{alert.details.size}}"
                	}, {{/if}} {
                    	"title": "Severity",
                    	"value": "{{alert.severity.display}}"
                	}
                	],
                	"separator": true
            	}
        	],
               
         	"actions": [
            	{
            	"type": "Action.OpenUrl",
            	"title": "View Active Alerts",
            	"url": "https://app.thousandeyes.com/alerts/list/active"
            	}
          	]
        	}
    	}
	]
}

8. Click on 'Test', to confirm you are getting an ‘Accepted 202’ response.

Mauro Step 3.8 (with 202).png

9. Return to MS Teams and verify you see a card with the bogus alert information being created by the workflow.

Mauro Step 3.9.png

And that’s it! If you’d like to see the video walkthrough of these same steps, you can review that here.

Comments
jyukon
Level 1
Level 1

Just what I was looking for.  Thank You

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: