Azure Web app Deployment with port binding

Bakar, Cem 281 Reputation points
2022-06-07T19:10:08.223+00:00

Hello all,
I am deploying a web app with the following code

   # creat the explainer dashboard  
   explainer = ClassifierExplainer(model, X, y)  
   db = ExplainerDashboard(explainer, title="TBS").run()  
     
   db = ExplainerDashboard(explainer)  
   server = db.flask_server()  

The web app container enables port 8000 by default - the class I am using uses 8050 by default.
I can force the app to use 8000 by db = ExplainerDashboard(explainer, title="TBS").run() but then I get an error saying OSError: [Errno 98] Address already in use

No matter what I enter in the configuration as a starting command I seem to get stuck with an either unknown or portalURL not found.

Any ideas how to align 8050 and 8000 together.

Thanks in advance

209251-screen-shot-2022-06-07-at-30632-pm.png

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,808 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
939 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Jaliya Udagedara 2,821 Reputation points MVP
    2022-06-08T10:20:43.707+00:00

    If your container listens to a different port, set the WEBSITES_PORT app setting in your App Service app.

    0 comments No comments

  2. ajkuma 26,216 Reputation points Microsoft Employee
    2022-06-10T13:25:21.097+00:00

    cmrbkr, Just following up to add to JaliyaUdagedara's suggestions.

    As JaliyaUdagedara mentioned, for custom containers. To manually configure a custom port (1 -port), use the EXPOSE instruction in the Dockerfile and the app setting, WEBSITES_PORT, with a port value to bind on the container.

    Azure App Service on Linux FAQ : Can I expose more than one port on my custom container image?

    • We don't support exposing more than one port.

    • Only one container can be open for access
    • Only port 80 and 8080 are accessible (exposed ports)

    How do I specify port in my Linux container?
    Refer the FAQ doc (above) to learn PORT environment variable vs WEBSITES_PORT

    Furthermore, you can provide configuration settings for Gunicorn through a gunicorn.conf.py file in the project root or startup cmd (as in your case) -yet, the startup command file can use whatever name you choose, such as startup.sh, startup.cmd, startup.txt, and so on. All commands must use relative paths to the project root folder.

    Checkout this doc Configure a Linux Python app for Azure App Service for details.

    Kindly let us know how it goes, I'll follow-up with you further.

    --
    To benefit the community find the right answers, please do mark the post which was helpful by clicking on Accept Answer’ & ‘Up-Vote’.

    0 comments No comments

  3. Bakar, Cem 281 Reputation points
    2022-06-16T12:56:21.29+00:00

    Thank you for your answers and time!

    I am puzzled with this one.
    The package I use requires specific command line and wants to use the port but so as the web app!

    I ended up using another package with does not require port usage.

    Thanks again,


  4. Atakan Gül 0 Reputation points
    2024-08-15T20:27:16.3133333+00:00

    Setting environment variables WEBSITES_PORT worked for me. If didn't worked, check your app's port usage what ports it uses. I recommend running it and using tools to see what ports are exposed. Most of the time it logs to the console though.

    If you have one port exposed (required), make sure to let the web app know about that (use env var). If still gives error, check the web app logs maybe there can be an app error because of requirements or simply because of the environment the app runs in.


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.