Azure Web as Container Port Configuration

mandar Jogalekar 36 Reputation points
2021-09-27T13:28:04.83+00:00

I am using following dockerhub image to setup sonarqube on azure web app as Containers.
https://hub.docker.com/layers/sonarqube/library/sonarqube/community/images/sha256-
ae28b0e22676abc26256d7eb1360207fb6ca871db3cb46cb73bfe4f9ed804a8b?context=explore

However, I am having trouble getting webapp to start up.In the logs I have an error.

Container  didn't respond to HTTP pings on port: 9000, failing site 
start. See container logs for debugging.

The image does Expose port 9000

As per MSDN Documentation, I have tried setting Application setting WEBSITES_PORT=9000

The same issue still persists.

Can anyone point to the reason here ? Does azure web app support dockerhub images which expose another port than 80 ?

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

2 answers

Sort by: Most helpful
  1. Takahito Iwasa 4,851 Reputation points MVP Volunteer Moderator
    2021-09-27T16:23:23.397+00:00

    Hi

    WEBSITE_PORT works.
    I think this is a separate issue from the port.

    Take a look a little higher in the log.

    Container xxx for site xxx has exited, failing site start

    I don't think I can respond because SonarQube is stopped for some reason.
    From the contents of the log, I think it is due to a problem similar to the following.

    https://community.sonarsource.com/t/sonarqube-container-latest-does-not-start/46498

    You may want to get the support of the SunarQube community.


    I understand that there are other issues you really want to solve, but if you just answer this question ...

    Does azure web app support dockerhub images which expose another port than 80?

    Answer: Yes. App Service is supported.

    0 comments No comments

  2. Tasadduq Burney 8,956 Reputation points MVP Volunteer Moderator
    2021-09-27T16:24:21.083+00:00

    Hello @mandar Jogalekar !

    Hope you are having a great day!

    Thank you for asking a Question! We are Glad to Assist you!

    By default, App Service assumes your custom container is listening on port 80

    If your container listens to a different port, set the WEBSITES_PORT app setting in your App Service app. That is an WEBSITES_PORT as one of your app settings with the port your app is listening.

    You can set it in Azure CLI:

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

    In Azure PowerShell:

    Set-AzWebApp -ResourceGroupName <group-name> -Name <app-name> -AppSettings @{"WEBSITES_PORT"="9000"}

    Note: App Service currently allows your container to expose only one port for HTTP requests.

    You may desire to also add the EXPOSE your-port command to the Docker file of your project. However, for my project I did not have to add the EXPOSE your-port command, and it worked fine for me.

    Resources: Configure a custom container for Azure App Service

    Regards,
    Tasadduq Burney

    __

    |- Please don't forget to "Upvote" and "Accept as answer" if the reply is helpful -|

    0 comments No comments

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.