Search code examples
c#azurebotframework

Publish bot to Azure


When I published my bot to Azure from Visual Studio and trying it on the web chat, it says can't send the message. Running the bot locally everything works just fine.

The emulator reports HTTP 500 error when trying to chat with the endpoint on azure.


Solution

  • After some discussions in the comment section, I've pulled your code from the repository you've provided. Different to what you were saying, it also crashes locally with HTTP 500 on start. Reading the logs gave me issues with web.config.

    This leads me to the following solution:

    Your codebase contains a web.config file which doesn't belong there. This is a .net core application and therefore should not rely on web.config and instead use appsettings.json. When this web.config gets deployed, the runtime tries to load certain things and crashes with HTTP 500.

    Not sure where this web.config comes from but I assume from previous deployments or some test of yours. I've send you a PR simply removing this web.config and deployed your bot to Azure.

    It works well:

    Azure deployed

    Make sure you've selected remove additional files at destination when you publish it from Visual Studio after removing web.config. This way you're making sure that you not accidentally leave an orphaned web.config there.
    VS Studio publish settings