Streamlit autorefreshing in Azure Container Apps

Hi all,

We’re struggling with an auto-refresh issue when running Streamlit behind Azure Container Apps (ACA) with an Azure Application Gateway (AGW) in front.

Environment

  • Streamlit 1.50.0

  • Hosting: ACA (Container Apps Environment)

  • Front door: Application Gateway → ACA

Symptoms

  • The page refreshes itself after idle time or during longer tasks.

  • Server logs show sessions disconnecting/reconnecting:

    Runtime state: ONE_OR_MORE_SESSIONS_CONNECTED -> NO_SESSIONS_CONNECTED
    Runtime state: NO_SESSIONS_CONNECTED -> ONE_OR_MORE_SESSIONS_CONNECTED
    
    
  • In DevTools:

    • WebSocket /_stcore/stream upgrades fine (101) but later drops.

    • /_stcore/health often returns 304 (Not Modified), and right after that the page reloads.

What we tried

  • Forced HTTP/1.1 backend in AGW (to avoid WS upgrade issues).

  • Increased AGW backend settings request timeout and idle timeout.

  • Enabled cookie sessions in AGW.

We know this has been a long-standing issue, but it’s been a while since anyone has posted about it, so we wanted to check if there’s already a solution.

1 Like