# Publishing Dash App on Azure App Service

**URL:** <https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786>\
**Category:** Dash Python\
**Created:** [August 21, 2025, 8:00pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786 "2025-08-21T20:00:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![JosephK](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@JosephK](https://community.plotly.com/u/JosephK)\
**Post date:** [August 21, 2025, 8:00pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/1 "2025-08-21T20:00:25Z")

</div>

Hi all,

I’ve been trying to deploy a dash app that works locally to Azure App Service. I’ve followed advice in a few older posts on this forum but it’s not working for me, so I’m making this new thread in the hopes that if things have changed since then, someone on here has has some wisdom they can share. My issue is similar to [this one](https://community.plotly.com/t/cant-deploy-python-dash-webapp-to-azure/69188), where the Deployment seems to be successful but the webpage itself displays an error message.

My code is in a python file called app.py. The body of it is

```python
app = Dash( __name__ , prevent_initial_callbacks=True, external_stylesheets=[dbc.themes.BOOTSTRAP])
server=app.server

#MAIN CODE BODY

if __name__ == ' __main__':
    app.run(debug=True) 

```

Then my configuration Start Command is

```auto
gunicorn --bind 0.0.0.0 app:server

```

Unfortunately, the webpage fails to display. I’ve confirmed that it runs locally with python app.py, as well as using waitress (the windows version of gunicorn). My gut feeling is that it’s something to do with ports, but I don’t know how to verify this. When I do specify something like

`gunicorn --bind 0.0.0.0:8050 app:server`

it makes no difference.

The build logs indicate that the requirements.txt file was successfully installed, and the build ends with

```auto
remote: Generating summary of Oryx build
remote: Parsing the build logs
remote: Found 0 issue(s)
remote: 
remote: Build Summary :
remote: ===============
remote: Errors (0)
remote: Warnings (0)
remote: 
remote: Triggering recycle (preview mode disabled).
remote: Deployment successful.

```

If anyone else has experienced this and has some insight, I’d appreciate the help!

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [August 22, 2025, 12:04am UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/2 "2025-08-22T00:04:35Z")

</div>

Hello @JosephK,

Welcome to the community!

Does it take a while for your app to spin up initially?

If so, that could be the issue due to a timeout that the web apps have by default.

---

<div class="post-metadata">

**Author:** ![sssaha1989](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@sssaha1989](https://community.plotly.com/u/sssaha1989)\
**Post date:** [August 22, 2025, 4:58am UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/3 "2025-08-22T04:58:22Z")

</div>

What I have found useful is downloading Docker Desktop and spinning up the application via Docker first - make sure everything works fine. Azure app service is built on Docker itself - so it is easy to debug and potential issue , spinning up time issue in Docker than via SSH on the Azure app service.

---

<div class="post-metadata">

**Author:** ![JosephK](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@JosephK](https://community.plotly.com/u/JosephK)\
**Post date:** [August 22, 2025, 1:12pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/4 "2025-08-22T13:12:58Z")

</div>

Oh that could be the issue! It’s a Weather dashboard that queries forecast data via WMS, and it takes a minute or two to load initially when it’s running those imports etc. Is there a configuration variable to extend that timeout?

---

<div class="post-metadata">

**Author:** ![JosephK](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@JosephK](https://community.plotly.com/u/JosephK)\
**Post date:** [August 22, 2025, 1:13pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/5 "2025-08-22T13:13:36Z")

</div>

That’s a good idea! I’ll see if I can do the troubleshooting in Docker if I can’t figure it out with the SSH tools, thanks!

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [August 22, 2025, 1:40pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/6 "2025-08-22T13:40:34Z")

</div>

Try setting the environment variable to the container:  
WEBSITES\_CONTAINER\_START\_TIME\_LIMIT  
to something like 600

---

<div class="post-metadata">

**Author:** ![JosephK](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@JosephK](https://community.plotly.com/u/JosephK)\
**Post date:** [August 22, 2025, 5:28pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/7 "2025-08-22T17:28:49Z")

</div>

Unfortunately, no luck there. I also replaced my app.py with a much simpler app that does nothing but display some text:

> from dash import Dash, html
> 
> import dash\_bootstrap\_components as dbc
> 
> app = Dash(\__name_\_, prevent\_initial\_callbacks=True, external\_stylesheets=[dbc.themes.BOOTSTRAP])
> 
> server=app.server
> 
> app.title = “This is a basic app that does nothing”
> 
> app.layout = html.Div([
> 
> ```
> html.H1(children="Maybe one day it will be a real app.", style={'textAlign':'center', 'margin': '10px'}, id='page_refresh'),
> 
> ```
> 
> ])
> 
> if \ __name_\_ == ‘\__ main_\_’:
> 
> ```
> app.run(debug=True) 
> 
> ```

This is also not working. Again, it runs fine locally and it is successfully deployed with no errors, but the webpage itself is just an error.

One thing that may or may not matter is that in most working examples I’ve seen, the command used is app.run\_server() as opposed to app.run, but run\_server is no longer supported.

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [August 22, 2025, 5:40pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/8 "2025-08-22T17:40:19Z")

</div>

What is your run command?

```auto
gunicorn --bind=0.0.0.0 --timeout 600 testApp:server

```

---

<div class="post-metadata">

**Author:** ![JosephK](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@JosephK](https://community.plotly.com/u/JosephK)\
**Post date:** [August 22, 2025, 5:57pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/9 "2025-08-22T17:57:07Z")

</div>

So the run command is

`gunicorn --bind 0.0.0.0 --timeout 600 app:server`

The code still lives in app.py, and the dash object is “app”, so I think this is the correct syntax.

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [August 22, 2025, 6:34pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/10 "2025-08-22T18:34:36Z")

</div>

Yeah, that should be working.

Just making sure, but your requirements.txt also has gunicorn on it?

---

<div class="post-metadata">

**Author:** ![JosephK](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@JosephK](https://community.plotly.com/u/JosephK)\
**Post date:** [August 22, 2025, 6:46pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/11 "2025-08-22T18:46:23Z")

</div>

It does!

And good news, it is now running. I replaced my requirements file with a much smaller one for just the newer version of the app containing nothing but dash, dash-bootstrap-components, and gunicorn. I’m now wondering if the issue with the “real” app is that there are a lot of large packages required, and the amount of time it needs to decompress the output.tar.gz file in wwwroot is long enough for it to time out. It’s an app for weather prediction and weather history, so it has things like dash-leaflet for a webmap to choose a location, a wms service, etc etc. I tried decompressing the output.tar.gz folder and it took about 5 minutes before I gave up.

Does that make sense? Have you heard of a virtual environment being “too big” to work with App Service?

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [August 22, 2025, 7:19pm UTC](https://community.plotly.com/t/publishing-dash-app-on-azure-app-service/93786/12 "2025-08-22T19:19:01Z")

</div>

It shouldnt be too large, but I also dont know what your requirements are.

It should be able to download the libraries that you need. Sometimes you can run into issues based upon packages not being available for certain types of OS and also Python versions.
