Hello Amir Basha,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are having application error after deploying azure open ai code to azure web app.
To troubleshoot this error, though it seems like a generic error but try and do the followings:
- Verify the Dockerfile and Application Port Configuration and confirm your application is explicitly set to listen on
0.0.0.0:8000
:- Dockerfile should include the following lines:
EXPOSE 8000
- For Python (Flask, FastAPI, etc.), for instance:
app.run(host="0.0.0.0", port=8000)
- Dockerfile should include the following lines:
- Use the Azure CLI or Azure portal to access detailed logs using bash command:
az webapp log tail --name <your-app-name> --resource-group <your-resource-group>
Investigate any application-specific errors (e.g., missing dependencies, runtime crashes). - View container-specific logs using bash command:
az webapp log deployment show --name <your-app-name> --resource-group <your-resource-group>
Look for errors like dependency issues or the application failing to bind to the expected port. - Run your Docker image locally to confirm it listens correctly:
docker run -p 8000:8000 <your-image> curl http://localhost:8000
- Check that
WEBSITES_PORT
is set to8000
in the Configuration tab in the Azure portal and verify no other environment variables override the application's port configuration. - Make sure the App Service Plan has sufficient resources (CPU, memory) and if running on Linux, verify the runtime matches your container's base image (e.g., Debian vs. Alpine).
- Check for any Network Security Groups (NSGs) or firewalls blocking traffic to port 8000 and make sure the App Service has outbound internet access for dependencies.
- Restart the container explicitly via Azure CLI using bash command:
az webapp restart --name <your-app-name> --resource-group <your-resource-group>
To monitor resource usage in the App Service to ensure the container has enough memory and CPU to start.
If logs or debugging indicate the issue isn't resolved:
- Validate the Azure App Service version and ensure compatibility with your container.
- Then, consider using Azure Monitor or App Insights for detailed diagnostics.
The following links are similar answers to your issue:
- https://learn.microsoft.com/en-us/answers/questions/1692830/container-hrchatbot06-0-03243f91-didnt-respond-to
- https://learn.microsoft.com/en-us/answers/questions/1149953/http-pings-on-port-8000-failing-site-start
- https://learn.microsoft.com/en-us/answers/questions/168746/container-didnt-respond-to-http-pings-on-port-8080
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.