How can I see possible Python errors in my Azure container?

tlcs 66 Reputation points
2022-02-15T08:23:48.623+00:00

Dear reader,

Currently I am running a simple Python based Q&A model in a container that can be accessed using a web application.

Recently we've updated the model with additional features and when we test the model locally it works fine. However when uploaded and deployed in Azure, whenever we send a request through the web application, the model does not give a response. I've tried looking into the 'App service logs' and the 'Log stream' but both give no errors whatsoever.

Even though the model works fine locally, I am pretty sure the problem lies somewhere within the Python code, because everything else (Python Image, authentication process etc.) is untouched. My question is, is there any way that I can see what is going on inside my container, so as to debug and find why my model is not giving an output? Or do you think the problem is with another part of my container?

Kind regards,

Tlcs

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,673 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ryan Hill 28,011 Reputation points Microsoft Employee
    2022-02-17T03:06:18.497+00:00

    Hi @tlcs ,

    For container apps, those logs are located at https://<app-name>.scm.azurewebsites.net/api/logs/docker/zip. You can learn more about accessing those logs on https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs#access-log-files. There are also a series of diagnostic tools that you can leverage to determine what's going on. I suggest starting with Availability and Performance. If you're using a custom image, logging will be picked up from stdout. However, if you're deploying your Python code into a Linux app service, then running az webapp log config --name <app-name> --resource-group <resource-group-name> --docker-container-logging filesystem from Azure CLI or in your Cloud Shell should be sufficient to get the logging you need.


0 additional answers

Sort by: Most helpful

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.