Container didn't respond to HTTP pings on port 80, failing site start while container to azure apps

Keerthivasan Chinnathambi 0 Reputation points
2025-03-18T04:42:43.2666667+00:00

I created a simple function app by the following the below documentation :https://learn.microsoft.com/en-us/azure/azure-functions/functions-deploy-container?tabs=acr%2Cbash%2Cazure-cli&pivots=programming-language-python

before building a docker image , I have obfuscate using pyarmor tool

and then build the docker image using the docker file and deployed to Azure function using github action,

I have created Azure Function as Container based in Azure Portal

The middleware successfully stated at 8181 port , but

the container app is not started

Container didn't respond to HTTP pings on port 80, failing site start while container to azure apps

Note :

I have tested the same container in local before deploying to Azure

by running

docker run -p 8080:80

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
748 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Khadeer Ali 4,615 Reputation points Microsoft External Staff
    2025-03-18T15:15:21.8+00:00

    @Keerthivasan Chinnathambi ,

    Thanks for reaching out. It seems that your Azure Function container is not responding to HTTP pings on port 80, which is causing the site to fail to start. By default, Azure App Service assumes that your custom container listens on port 80. If your application is configured to listen on a different port, such as 8181, you need to set the WEBSITES_PORT app setting in your Azure App Service to match the port your application is using.

    You can set this using the Azure CLI with the following command:

    az webapp config appsettings set --resource-group <group-name> --name <app-name> --settings WEBSITES_PORT=8181
    

    Make sure to replace <group-name> and <app-name> with your actual resource group and app name.

    Additionally, ensure that your Dockerfile has the correct EXPOSE directive for the port your application is listening on. Since you mentioned that the middleware is running on port 8181, it should be reflected in your Dockerfile as follows:

    EXPOSE 8181
    

    After making these changes, try redeploying your container to Azure and let us know if you are still facing the issue.


    References:

    If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.


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.