Learn more about Microsoft Teams alerts in the Microsoft Teams Alerts documentation.
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.
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:
ParameterTypeRequiredDefaultDescription
urlstring-Microsoft Teams webhook URL created by the Workflow
namestring-Friendly name to recognize the integration
payloadstring-Custom payload for the alert message

Examples

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",
  },
})

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.