Microsoft Teams Destination
Post messages to a Microsoft Teams channel via an Incoming Webhook. Supports plain text / MessageCard and Adaptive Card JSON payloads.
YAML Exampleโ
destination:
type: teams
webhook_url_env: TEAMS_WEBHOOK_URL
message_template: "๐ New signup: **{{ row.name }}** ({{ row.email }})"
Configurationโ
| Field | Type | Default | Description |
|---|---|---|---|
type | "teams" | โ | Required |
webhook_url | string | null | null | Webhook URL (direct value) |
webhook_url_env | string | null | null | Env var containing the webhook URL |
message_template | string | "{{ row }}" | Jinja2 template for the message body |
adaptive_card | bool | false | If true, treat message_template as an Adaptive Card JSON payload |
retry | object | null | null | Per-destination retry override (see sync.retry) |
Authenticationโ
Create an Incoming Webhook connector on the target Teams channel (channel โ โฏ โ Connectors โ Incoming Webhook), then store the URL in an env var:
export TEAMS_WEBHOOK_URL="https://outlook.office.com/webhook/..."
Prefer
webhook_url_envover the inlinewebhook_urlโdrt validateflags hardcoded secrets (v0.7.5+).
Common Patternsโ
Plain text alert:
message_template: "๐จ **Alert:** {{ row.message }} (severity: {{ row.level }})"
Adaptive Card (richer layout โ the template is the full Adaptive
Card JSON; drt wraps it in the attachments envelope):
adaptive_card: true
message_template: |
{
"type": "AdaptiveCard",
"version": "1.4",
"body": [
{ "type": "TextBlock", "size": "Medium", "weight": "Bolder",
"text": "{{ row.name }} just signed up" },
{ "type": "TextBlock", "text": "Email: {{ row.email }}", "wrap": true }
]
}
Rate limitingโ
Vendor limit: Microsoft throttles incoming webhooks per connector (commonly documented as ~4 requests/second per connector, with longer-window caps). drt applies no automatic cap here โ set one explicitly:
destination:
type: teams
webhook_url_env: TEAMS_WEBHOOK_URL
rate_limit:
requests_per_second: 4
burst: 4 # optional: allow a short catch-up burst after idle time
destination.rate_limit beats sync.rate_limit, which beats the default of 10/s.
The limiter is shared per webhook URL โ and since a Teams webhook is channel-scoped, that means per channel. Several syncs posting to one channel concurrently (drt run --threads 4) pace through one bucket instead of one bucket each. When two syncs share a webhook but request different rates, the lowest wins for both.
Notesโ
- (core) โ no extra install required.
- One POST per row. For real-time alerts use
batch_size: 1; for bursty syncs setrate_limit.requests_per_secondto stay under the channel's webhook throttling. - Webhook delivery failures surface as row errors;
on_error: skip(default for webhook-style destinations) keeps the rest of the batch going. - The webhook URL is channel-scoped โ one URL per channel. Use a sync-specific webhook to route different syncs to different channels.