Area: Observability
Sub-Area: Notifications
Issue
Microsoft Teams notifications are not being sent from DataHub, or message cards are not rendering correctly. This typically occurs due to incorrect webhook configuration or Teams connector limitations.
You Might Be Asking:
- How do I send DataHub alerts to Teams?
- What's the difference between Teams webhook types?
- Can I use adaptive cards for Teams messages?
Solution
- Create Teams incoming webhook:
This is specific to Microsoft Teams integration. The webhook creation process is specific to Teams' API.
1. In Teams channel, click "..." → Connectors
2. Search for "Incoming Webhook"
3. Click "Configure"
4. Name the webhook (e.g., "DataHub Alerts")
5. Optionally upload an image
6. Copy the webhook URL
7. Click "Done"
- Configure Teams in DataHub Actions:
Example for Microsoft Teams notifications. This can be adapted for other notification platforms like Slack, email, or custom webhooks.
# actions-config.yml
action:
type: "teams"
config:
webhook_url: "${TEAMS_WEBHOOK_URL}"
# Message format
message_format: "ADAPTIVE_CARD" # or "MESSAGE_CARD"
# Filters
filters:
- event_type: "ASSERTION_RESULT"
status: "FAILURE"
- event_type: "INCIDENT_CREATED"
- Use Adaptive Card format:
Example for Microsoft Teams Adaptive Card formatting. This can be adapted for other notification platforms with their respective message formatting standards.
action:
type: "teams"
config:
webhook_url: "${TEAMS_WEBHOOK_URL}"
# Adaptive Card template
adaptive_card_template: |
{
"type": "AdaptiveCard",
"version": "1.4",
"body": [
{
"type": "TextBlock",
"text": "DataHub Alert",
"weight": "Bolder",
"size": "Large"
},
{
"type": "FactSet",
"facts": [
{
"title": "Event Type:",
"value": "{{ event.type }}"
},
{
"title": "Dataset:",
"value": "{{ dataset.name }}"
},
{
"title": "Time:",
"value": "{{ event.timestamp }}"
},
{
"title": "Severity:",
"value": "{{ event.severity }}"
}
]
},
{
"type": "TextBlock",
"text": "{{ event.description }}",
"wrap": true
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "View in DataHub",
"url": "{{ dataset.url }}"
}
]
}
- Test Teams webhook:
Example for Microsoft Teams webhook testing. This can be adapted for other notification platforms.
# Test with simple message
curl -X POST ${TEAMS_WEBHOOK_URL} \
-H 'Content-Type: application/json' \
-d '{
"text": "Test message from DataHub"
}'
# Test with message card
curl -X POST ${TEAMS_WEBHOOK_URL} \
-H 'Content-Type: application/json' \
-d '{
"@type": "MessageCard",
"@context": "https://schema.org/extensions",
"summary": "DataHub Test",
"themeColor": "0078D7",
"title": "Test from DataHub",
"text": "This is a test notification"
}'
- Handle Teams webhook rate limits:
Example for Microsoft Teams rate limiting. This can be adapted for other notification platforms with their respective rate limit requirements.
action:
type: "teams"
config:
webhook_url: "${TEAMS_WEBHOOK_URL}"
# Throttling to avoid rate limits
# Teams limit: 4 calls per second per webhook
rate_limit:
max_requests_per_second: 3
# Batch notifications
batch_notifications:
enabled: true
max_batch_size: 10
batch_interval_seconds: 60
Additional Notes
Teams webhooks have rate limits (4 requests/second). For high-volume scenarios, implement batching. Adaptive Cards provide richer formatting than simple Message Cards. Test webhook connectivity from DataHub Actions pod.
Related Documentation
Tags:
teams, microsoft-teams, notifications, webhooks, adaptive-cards, alerts, integrations, office365