Share via

azure chatbot 403

XIANG Jirui (ME/ECO-CN) 0 Reputation points
2026-04-13T10:25:14.7133333+00:00

when I test echo chatbot on azure bot web chat, it always returns 403

2026-04-13 09:53:39,591 [INFO] aiohttp.access - 10.244.17.9 [13/Apr/2026:09:53:39 +0000] "OPTIONS /api/messages HTTP/1.1" 403 286 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36 Edg/146.0.0.0"

checked with app_id and app password, it should be correct.

should I do config in web chat? how I config my token?

Azure AI Bot Service
Azure AI Bot Service

An Azure service that provides an integrated environment for bot development.


1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-04-13T10:25:32.61+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    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:

    1. Verify the bot works locally without security
      • In the bot code, temporarily disable security:
        • .NET: in appsettings.json set:
                 "MicrosoftAppId": "",
                 "MicrosoftAppPassword": ""
          
        • JavaScript: in .env configure the adapter with:
                 const adapter = new BotFrameworkAdapter({
                     appId: null,
                     appPassword: null
                 });
          
        • Python: in config.py:
                 class DefaultConfig:
                     APP_ID = None
                     APP_PASSWORD = None
          
      • Run the bot on localhost.
      • Use Bot Framework Emulator and connect to http://localhost:<port>/api/messages with Microsoft App ID and Microsoft App Password left empty.
      • If this fails, fix endpoint/port/path issues first (ensure /api/messages and correct port).
    2. Re‑enable security and test locally
      • Restore the correct MicrosoftAppId and MicrosoftAppPassword in the bot configuration.
      • In Emulator, connect to http://localhost:<port>/api/messages and provide the same App ID and password.
      • If this fails, the App ID/password pair is invalid or mismatched with the bot registration.
    3. 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.
    4. 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 https and use a valid, chain‑trusted certificate.
        • App ID and password in the bot code match the values configured for the Azure Bot resource.
    5. 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:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.