An Azure service that provides an integrated environment for bot development.
Hi sherlock457,
It sounds like your Teams-hosted bot used to work through your Cloudflare Tunnel but now Teams messages never hit your local /api/messages endpoint—and sometimes you see a CORS block complaining about azure.com not being allowed. Let’s break down some things to check and next steps:
- Verify your tunnel & messaging endpoint
- Make sure your Cloudflare Tunnel is up and forwarding HTTPS traffic to your local bot port (typically 3978).
- In the Azure portal, open your Bot’s Configuration (Messaging endpoint) and confirm it exactly matches your tunnel URL +
/api/messages. - If you’ve recently rotated URLs or redeployed the tunnel container, update the endpoint and hit Apply.
- Test reachability from outside
- From any machine on the public internet (for example, via a phone hotspot), run:
curl -I https://<your-tunnel>.trycloudflare.com/api/messagesYou should get back a 405 (method not allowed) or 400, not a connection error. - Then POST a minimal activity payload to see if it even touches your app:
- From any machine on the public internet (for example, via a phone hotspot), run:
bash
curl -X POST https://<your-tunnel>.trycloudflare.com/api/messages \
-H "Content-Type: application/json" \
-d '{"type":"message","from":{"id":"test"},"text":"hello"}'
```
If nothing logs locally, the tunnel or Azure Bot Service registration is still off.
Docs: “How do I test network connectivity between bots and a channel?”
- Is it a pure Teams-to-Bot Service call or client-side Web Chat?
- Teams channel calls your bot via the Azure Bot Service proxy (server-to-server), so CORS isn’t involved and no Origin header should be set.
- If you’re embedding the Bot Framework Web Chat control in a Teams tab (or similar) you will see browser CORS preflights. In that case you need to allow the browser’s Origin (e.g.
https://teams.microsoft.comor*.azure.com) in your CORS policy.
Example for an Express app:
```js
const cors = require('cors');
app.use(cors({
origin: [
'https://teams.microsoft.com',
/\.azure\.com$/
],
credentials: true
}));
- Quick Web Chat sanity check
- In your Bot’s resource blade, switch to the Web Chat test panel and try sending a message.
- If Web Chat fails the same way, you’ve pinpointed the issue to your tunnel/CORS settings, not the Teams channel.
- If everything above looks good but Teams still doesn’t connect
- Remove & re-add the Teams channel in Azure Bot Service.
- Double-check your Bot’s Microsoft App ID & Password in your local app settings—an auth hiccup could prevent server-to-server calls.
- Review Cloudflare logs to see if any requests from Azure Bot Service IPs are being blocked or rate-limited by your tunnel.
Follow-up questions to narrow this down:
• Can you successfully reach your tunnel endpoint with curl/Postman from a public network?
• Are you testing via the Teams client channel or embedding Web Chat in a Teams tab?
• What domain/origin does your backend’s CORS middleware currently allow?
• Have you updated the Messaging endpoint in the Azure portal since your tunnel URL last changed?
Hope this helps you pinpoint where the request is getting stuck! Let me know what you see when you run those curl tests and which scenario (pure Teams vs. browser Web Chat) you’re running.
Reference list:
2. How do I test network connectivity between bots and a channel?
Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.
Please do not forget to "Accept Answer" and "up-vote" wherever the information provided helps you, as this can be beneficial to other community members.