Use Microsoft Teams Alert Channels to send notifications to Microsoft Teams channels when checks fail or recover. Teams alerts help keep your team informed and enable quick collaboration on issues.
Basic Example
Advanced Example
import { MSTeamsAlertChannel } from "checkly/constructs"
const teamsChannel = new MSTeamsAlertChannel ( "teams-channel-1" , {
name: "Dev Team Alerts" ,
url: "https://prod-24.westus.logic.azure.com:443/workflows/xxxxx" ,
})
Configuration
Configure Microsoft Teams-specific settings: Parameter Type Required Default Description urlstring✅ - Microsoft Teams webhook URL created by the Workflow namestring❌ - Friendly name to recognize the integration payloadstring❌ - Custom payload for the alert message
Configure common alert channel properties: Property Type Required Default Description sendRecoveryboolean❌ trueSend notifications when checks recover sendFailureboolean❌ trueSend notifications when checks fail sendDegradeboolean❌ falseSend notifications when checks degrade (API checks only) sslExpiryboolean❌ falseSend notifications for SSL certificate expiry sslExpiryThresholdnumber❌ 30Days before SSL expiry to send notification
Examples
Development Team
Operations Team
Multi-Team Notifications
Environment-Specific
import { MSTeamsAlertChannel , ApiCheck } from "checkly/constructs"
const devTeamsAlert = new MSTeamsAlertChannel ( "dev-team-alerts" , {
name: "Development Team Alerts" ,
url: "https://prod-24.westus.logic.azure.com:443/workflows/dev-team-webhook" ,
})
new ApiCheck ( "dev-api-check" , {
name: "Development API Health" ,
alertChannels: [ devTeamsAlert ],
tags: [ "development" , "api" ],
request: {
method: "GET" ,
url: "https://dev-api.example.com/health" ,
},
})
import { ApiCheck , MSTeamsAlertChannel } from "checkly/constructs"
const opsTeamsAlert = new MSTeamsAlertChannel ( "ops-team-alerts" , {
name: "Operations Team Alerts" ,
url: "https://prod-24.westus.logic.azure.com:443/workflows/ops-team-webhook" ,
sendRecovery: true ,
sendFailure: true ,
sendDegraded: true , // Ops team wants to know about degraded performance
})
new ApiCheck ( "infrastructure-check" , {
name: "Infrastructure Health Check" ,
alertChannels: [ opsTeamsAlert ],
maxResponseTime: 5000 ,
degradedResponseTime: 2000 ,
tags: [ "infrastructure" , "operations" ],
request: {
method: "GET" ,
url: "https://infrastructure.example.com/health" ,
},
})
import { ApiCheck , MSTeamsAlertChannel } from "checkly/constructs"
const devTeams = new MSTeamsAlertChannel ( "dev-teams" , {
name: "Development Team" ,
url: "https://prod-24.westus.logic.azure.com:443/workflows/dev-webhook" ,
})
const opsTeams = new MSTeamsAlertChannel ( "ops-teams" , {
name: "Operations Team" ,
url: "https://prod-24.westus.logic.azure.com:443/workflows/ops-webhook" ,
})
const businessTeams = new MSTeamsAlertChannel ( "business-teams" , {
name: "Business Team" ,
url: "https://prod-24.westus.logic.azure.com:443/workflows/business-webhook" ,
sendFailure: true ,
sendRecovery: true ,
sendDegraded: false , // Business team only needs to know about failures
})
new ApiCheck ( "multi-team-check" , {
name: "Cross-Team Critical Service" ,
alertChannels: [ devTeams , opsTeams , businessTeams ],
tags: [ "cross-team" , "critical" ],
request: {
method: "GET" ,
url: "https://critical-service.example.com/health" ,
},
})
import { ApiCheck , MSTeamsAlertChannel } from "checkly/constructs"
const prodTeams = new MSTeamsAlertChannel ( "prod-teams" , {
name: "Production Alerts" ,
url: "https://prod-24.westus.logic.azure.com:443/workflows/prod-webhook" ,
})
const stagingTeams = new MSTeamsAlertChannel ( "staging-teams" , {
name: "Staging Environment Alerts" ,
url: "https://prod-24.westus.logic.azure.com:443/workflows/staging-webhook" ,
sendDegraded: true , // More tolerant for staging
})
// Production monitoring
new ApiCheck ( "prod-api-check" , {
name: "Production API" ,
alertChannels: [ prodTeams ],
tags: [ "production" ],
request: {
method: "GET" ,
url: "https://api.example.com/health" ,
},
})
// Staging monitoring
new ApiCheck ( "staging-api-check" , {
name: "Staging API" ,
alertChannels: [ stagingTeams ],
tags: [ "staging" ],
maxResponseTime: 10000 , // More lenient for staging
degradedResponseTime: 5000 ,
request: {
method: "GET" ,
url: "https://staging-api.example.com/health" ,
},
})
Setting Up Microsoft Teams Webhooks
Find more information on how to set up a Microsoft Teams workflows in the Microsoft Teams documentation .
Environment Variables
Store your Teams webhook URLs securely using environment variables:
const teamsChannel = new MSTeamsAlertChannel ( "teams-alerts" , {
name: "Team Notifications" ,
url: process . env . TEAMS_WEBHOOK_URL ! ,
})
# .env
TEAMS_WEBHOOK_URL = https://prod-24.westus.logic.azure.com:443/workflows/xxxxx
Best Practices
Webhook Security : Keep your Teams webhook URLs secure. Anyone with access to the URL can send messages to your Teams channels.
Channel Selection : Choose appropriate Teams channels for different types of alerts. Consider creating dedicated monitoring channels to avoid noise in general discussion channels.