How to fix GET Request for Bot url in Azure after deployment with Teams Toolkit?

tbsonio 0 Reputation points
2025-02-25T10:24:01.0366667+00:00

Hi everyone

I have created a custom Bot to use in Teams with the Teams Toolkit. I have used my own api end points for a custom LLM. When deploying the Bot locally (Debug in Testtool), the Bot works just fine.

I deployed everthing in Azure (through the toolkit) and also defined the .env secret variables in the app service of the ressource group.

Through the App insights i can see that there is always one error for calling the bot. I get a 404 back, when calling the GET request for the bot url.

Does someone has a solution for this?

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
902 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 18,861 Reputation points
    2025-02-25T16:08:10.1066667+00:00

    Hello tbsonio,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are in need of how you can fix GET Request for Bot URL in Azure after deployment with Teams Toolkit.

    This is a generic error, so, the below might be lengthy to cover all the aspect:

    1. Verify the Messaging Endpoint in Azure Bot Service that it matches your App Service URL with /api/messages - https://<app-service-name>.azurewebsites.net/api/messages - https://techcommunity.microsoft.com/discussions/teamsdeveloper/teams-bot-not-working-when-deployed/4287129
    2. In the Azure Portal, go to your App Service and confirm the environment variables in App Service that there are no typos or missing variables.
    3. Make sure your bot code handles requests at /api/messages. For an example:
         // Node.js (Express)
              server.post('/api/messages', async (req, res) => { ... });
      
              // C# (ASP.NET Core)
              [Route("api/messages")]
              public class BotController : ControllerBase { ... }
      
      check similar answers here: https://learn.microsoft.com/en-us/answers/questions/2087014/my-teams-bot-cannot-access-the-openai-api-error-40
    4. Enable application logging by using Log Stream to view real-time logs and check for startup errors.
    5. Use curl or Postman to send a GET request to test the endpoint manually: GET https://<app-service-url>/api/messages A 401 Unauthorized response suggests the endpoint exists but requires auth. A 404 means the route isn't mapped. So, check thoroughly.
    6. Check the Deployment Center in your App Service for deployment errors and make sure all files (Your artifact, including package.json/.csproj dependencies) are deployed correctly.
    7. In the App Service, under CORS, add https://*.botframework.com as an allowed origin .
    8. Check app registration in Azure AD, to verify the App Registration linked to your Bot has correct redirect URIs: https://token.botframework.com/.auth/web/redirect and permissions.
    9. Redeploy the bot via Teams Toolkit and restart the App Service from the Azure Portal.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    0 comments No comments

Your answer

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