A lightweight Docker-based proxy service that transforms Sentry webhook payloads into Microsoft Teams Adaptive Card format for Power Automate integration.
This proxy solves the incompatibility between Sentry's webhook format and basic Teams webhooks in Power Automate. It receives webhooks from Sentry, transforms them into Teams-compatible Adaptive Cards, and forwards them to your Power Automate workflow.
Perfect for teams using Sentry (self-hosted or cloud) who want beautifully formatted alerts in Microsoft Teams without complex integrations.
- Transforms Sentry webhooks to Teams Adaptive Card format
- Docker-based for easy deployment
- Health check endpoint
- Comprehensive logging
- Support for different Sentry alert levels (error, warning, info, etc.)
- Color-coded messages based on severity
- Direct links to Sentry issues from Teams
webhook-proxy/
āāā src/
ā āāā index.js # Main application
āāā Dockerfile # Docker image configuration
āāā docker-compose.yml # Docker Compose setup
āāā package.json # Node.js dependencies
āāā .env # Environment variables (contains webhook URL)
āāā .env.example # Example environment file
āāā nginx-webhook.conf # Nginx configuration for DNS access
āāā PLAN.md # Implementation plan
āāā README.md # This file
- Docker and Docker Compose installed
- Access to Sentry (self-hosted or cloud)
- Microsoft Power Automate with Teams connector
- A server or machine where you can run Docker containers
- Go to Power Automate
- Create a new Instant cloud flow
- Choose When an HTTP request is received as the trigger
- Add an action: Post adaptive card in a chat or channel (Teams connector)
- Configure your Teams channel/chat
- Save the flow and copy the HTTP POST URL that's generated
- This URL is your
TEAMS_WEBHOOK_URLfor the.envfile
# Clone the repository
git clone https://github.com/dcoric/sentry-teams-webhook.git
cd sentry-teams-webhook
# Copy the example environment file
cp .env.example .env
# Edit .env and add your Teams webhook URL
nano .env # or use your preferred editorIn the .env file, replace the placeholder with your actual Power Automate Teams webhook URL:
TEAMS_WEBHOOK_URL=https://prod-XX.westus.logic.azure.com:443/workflows/...
Build and start the container:
# Build and start the container
docker-compose up -d
# Check if it's running
docker-compose ps
# View logs
docker-compose logs -fTest the health endpoint:
curl http://localhost:3000/healthYou should see:
{
"status": "ok",
"timestamp": "2025-11-16T...",
"webhookConfigured": true
}In your Sentry project:
- Go to Settings ā Integrations ā WebHooks
- Add a new webhook with URL:
http://localhost:3000/teams-hook - Select the events you want to receive (e.g., issue alerts)
- Save the webhook
Trigger a test event in Sentry or use curl:
curl -X POST http://localhost:3000/teams-hook \
-H "Content-Type: application/json" \
-d '{
"action": "created",
"data": {
"issue": {
"title": "Test Issue",
"level": "error",
"web_url": "https://sentry.example.com/issues/123"
}
},
"project_name": "my-project"
}'You should receive a message in Teams!
Use http://localhost:3000/teams-hook in Sentry configuration.
- Pros: Simple, no additional setup needed
- Cons: Only accessible from the local server
To make the webhook accessible from the internet (required if Sentry is on a different server):
# Edit the nginx config with your domain
sudo nano /etc/nginx/sites-available/your-domain.com
# Create symbolic link to sites-enabled
sudo ln -s /etc/nginx/sites-available/your-domain.com /etc/nginx/sites-enabled/
# Test nginx configuration
sudo nginx -t
# Reload nginx
sudo systemctl reload nginxExample nginx configuration (see nginx-webhook.conf in this repo):
server {
listen 80;
server_name your-domain.com;
location /teams-hook {
proxy_pass http://localhost:3000/teams-hook;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}Add an A record for your-domain.com pointing to your server's public IP address.
# Install certbot if not already installed
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx
# Obtain SSL certificate
sudo certbot --nginx -d your-domain.com
# Certbot will automatically update the nginx config to use HTTPSChange the webhook URL in Sentry to: https://your-domain.com/teams-hook
Service information and available endpoints
Health check endpoint
- Returns service status
- Checks if Teams webhook URL is configured
Main webhook endpoint for receiving Sentry webhooks
- Accepts Sentry webhook payload
- Transforms to Teams Adaptive Card format
- Forwards to Power Automate
Edit .env file:
# Port for the webhook proxy server
PORT=3000
# Teams webhook URL from Power Automate
TEAMS_WEBHOOK_URL=https://your-webhook-url...docker-compose restart# Follow logs in real-time
docker-compose logs -f
# View last 100 lines
docker-compose logs --tail=100# List containers
docker-compose ps
# Check health
docker inspect sentry-teams-proxy --format='{{.State.Health.Status}}'# Pull latest changes (if using git)
git pull
# Rebuild and restart
docker-compose down
docker-compose up -d --builddocker-compose downdocker-compose down -v- Check logs:
docker-compose logs -f - Verify Teams webhook URL in
.env - Test health endpoint:
curl http://localhost:3000/health - Ensure container is running:
docker-compose ps
- Verify the proxy is accessible from Sentry server
- Check firewall rules if using DNS access
- Test connectivity:
curl http://localhost:3000/healthfrom Sentry server
Power Automate webhook URLs can expire. If you see 401/403 errors:
- Generate a new webhook URL in Power Automate
- Update
.envfile with new URL - Restart:
docker-compose restart
The proxy creates Adaptive Cards with:
- Alert emoji based on severity level (š“ for errors,
ā ļø for warnings, etc.) - Project name and alert level
- Issue title and message
- Action button linking to Sentry issue
š“ Sentry Alert: created
Project: my-project
Level: ERROR
Title: TypeError: Cannot read property 'x' of undefined
Message details...
[View in Sentry] (button)
- The
.envfile contains sensitive webhook URLs - keep it secure - Consider using HTTPS (nginx with SSL) for production
- The Power Automate webhook URL includes authentication tokens
- Webhook URLs should not be committed to version control (see
.gitignore)
Contributions are welcome! Please feel free to submit a Pull Request. For major changes:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Potential future enhancements:
- Support for other monitoring platforms (PagerDuty, Datadog, etc.)
- Customizable Adaptive Card templates
- Message filtering and routing rules
- Metrics and monitoring dashboard
MIT License - feel free to use this project for personal or commercial purposes.
If you encounter issues or have questions:
- Open an issue on GitHub
- Check existing issues for solutions
- Contribute improvements via pull requests