AxiosError: Request failed with status code 504 on Streamlit app hosted on Azure App Serivce

Hi,

I’m trying to build a front-end to upload files using the st.file-uploader and trigger some custom pipelines. The files can be up to 4G. When testing on local works fine, but when deployed to azure I get 504 error. “AxiosError: Request failed with status code 504” when uploading a file.

I read on several posts to try disabling XSRF and CORS, but still not working. My config.toml looks like:

[server]
maxUploadSize = 4096  # Size in megabytes (4GB = 4096MB)
enableWebsocketCompression = false
runOnSave = true
enableStaticServing = true
enableXsrfProtection = false
enableCORS = false
port=80

The app is containerised and my DOCKERFILE looks like

# Use Python 3.12 as the base image
FROM python:3.12 as build

# Set working directory
WORKDIR /code/app

# Copy requirements.txt into the image
COPY ./requirements.txt /code/requirements.txt

# Install dependencies
RUN pip install --default-timeout=100 --no-cache-dir --upgrade -r /code/requirements.txt

# Copy the application code into the image
COPY ./src/ /code/app/

# Expose the port Streamlit will run on
EXPOSE 80

# Set the command to run the application
CMD ["streamlit", "run", "main.py", "--server.address=0.0.0.0", "--server.port=80"]

Anyone has an idea how to solve this issue?