This is my second thread about this issue and I tried every suggestion provided in the last thread about this. The URL to the last thread is here: Bot works in Bot Framework Emulator on local computer, but not after it's deployed to Microsoft Azure - HTTP status code NotFound.
I followed the exact directions at https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-deploy-az-cli?view=azure-bot-service-4.0&tabs=newrg.
After following these instructions involving Azure CLI, I had three resource types that were created under my Azure subscription ID: Bot Channels Registration, App Service, and App Service Plan.
Unfortunately, when I enter a message in the “Test in Web Chat” window under “Bot Management” for the “Bot Channels Registration” resource, I received a message back saying “couldn’t send retry.”
When I go to channels under “Bot Management” for the “Bot Channels Registration” resource, click “Issues” under “Health”, I see this message: "There was an error sending this message to your bot: HTTP status code InternalServerError."
Here are some additional details that were highlighted in the last thread. I definitely took them into consideration as you’ll read below.
Before entering this code, a “.deployment” file was created in the bot’s directory and a zip file was subsequently created that contained the “.deployment” file in it: az webapp deployment source config-zip --resource-group "" --name "" --src "code.zip"
I went to this link, and I saw 21 .dll files listed on that page under the “WWWROOT” section: https:/.scm.azurewebsites.net/dev/wwwroot/
I went to this URL (https://.scm.azurewebsites.net/dev/wwwroot/:vs.output), pressed run and I did not see anything unusual on the right side of the screen under “Output”. It says “200.0 OK” at the last message under “Output” after “Click on http://.azurewebsites.net to open your site 2019-06-27T17:52:04 PID[32228] Information Sending response.” When I click on the “http://.azurewebsites.net” link, a new tab opens and I see this message at the top: " Bot Started."
I also tried publishing from Visual Studio.
When I tried publishing from Visual Studio, I followed the directions at this page: https://docs.microsoft.com/en-us/visualstudio/deployment/deploying-applications-services-and-components?view=vs-2019
I created a new Azure App Service, chose the correct subscription and resource group, turned off Application Insights since that’s not needed right now, and then pressed “Create.”
I then pressed “Publish.”
Next, I created a Bot Channels Registration and added the destination URL from the edit link at the top of “Publish” screen in Visual Studio. That bot did not work when testing in the web chat.
Creating a web app bot in Azure doesn’t help at this stage since a default echo or basic bot template seems required for the creation.
Just to elaborate again, the bot I’m attempting to test in Azure works perfectly in the bot emulator after running it in Visual Studio. Somewhere in the publishing/deployment stage to Azure lies an issue. What can we do to resolve this issue?
UPDATE:
I followed Matt Stannett's advice, who added a comment under this thread.
I went to Monitoring > App Service Logs and enabled Application Logging (Filesystem) as well as Detailed error messages and Failed request tracing.
Next, I went to Monitoring > Log stream tab. I kept this tab opened and loaded up Web Chat in another tab to see real-time logs.
I converted the html code to the pdf format and read the results.
Here is the top-level information regarding the error message:
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Most likely causes:
- IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
- IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
- IIS was not able to process configuration for the Web site or application.
- The authenticated user does not have permission to use this DLL.
- The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
Things you can try:
- Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
- Check the event logs to see if any additional information was logged.
- Verify the permissions for the DLL.
- Install the .NET Extensibility feature if the request is mapped to a managed handler.
- Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Detailed Error Information:
Error Code: 0x00000000
Module: AspNetCoreModule
Handler: aspNetCore
Notification: ExecuteRequestHandler
Logon Method: Anonymous
Logon User: Anonymous
More Information:
This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error. View more information »