An Azure service that provides an integrated environment for bot development.
HTTP 403 from /api/messages in Azure Bot Web Chat usually means the bot service is rejecting the request due to configuration, authentication, or hosting issues, not that Web Chat itself needs extra token configuration.
Use the standard troubleshooting flow for Bot Framework authentication and bot configuration:
- Verify the bot works locally without security
- In the bot code, temporarily disable security:
- .NET: in
appsettings.jsonset:"MicrosoftAppId": "", "MicrosoftAppPassword": "" - JavaScript: in
.envconfigure the adapter with:const adapter = new BotFrameworkAdapter({ appId: null, appPassword: null }); - Python: in
config.py:class DefaultConfig: APP_ID = None APP_PASSWORD = None
- .NET: in
- Run the bot on localhost.
- Use Bot Framework Emulator and connect to
http://localhost:<port>/api/messageswith Microsoft App ID and Microsoft App Password left empty. - If this fails, fix endpoint/port/path issues first (ensure
/api/messagesand correct port).
- In the bot code, temporarily disable security:
- Re‑enable security and test locally
- Restore the correct
MicrosoftAppIdandMicrosoftAppPasswordin the bot configuration. - In Emulator, connect to
http://localhost:<port>/api/messagesand provide the same App ID and password. - If this fails, the App ID/password pair is invalid or mismatched with the bot registration.
- Restore the correct
- Confirm the bot is running and reachable in Azure
- In Azure portal, open the bot’s App Service (or hosting resource).
- From the Overview pane, copy the Messaging endpoint and open it in a browser.
- If it returns HTTP 404 or 405, the bot is reachable and responding.
- If the browser shows “This site can’t be reached” or similar, the bot is down and must be redeployed or started.
- Test in Web Chat from the Azure Bot resource
- In Azure portal, open the Azure Bot resource.
- Use Test in Web Chat.
- If Web Chat shows errors and the App Service logs show 403 on
/api/messages, check:- Messaging endpoint on the bot’s Settings page:
- Must be correct and include
/api/messages. - Must start with
httpsand use a valid, chain‑trusted certificate.
- Must be correct and include
- App ID and password in the bot code match the values configured for the Azure Bot resource.
- Messaging endpoint on the bot’s Settings page:
- No extra token configuration is needed in Web Chat
- The built‑in Web Chat in the Azure portal uses the bot’s configured credentials and endpoint automatically.
- 403 errors are resolved by fixing:
- Bot authentication (valid App ID/password in both bot code and Azure Bot resource).
- Correct HTTPS messaging endpoint.
- Ensuring the bot is deployed, running, and reachable.
Once the bot responds correctly in Test in Web Chat with security enabled and a valid HTTPS endpoint, the 403 errors should stop, and no manual token configuration in Web Chat is required.
References: