Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
App Service Using Streamlit Gets Stuck and Does Not Load the Application Intermittently
Hello All,
We recently experienced an issue with our Streamlit application hosted on Azure App Service (B3:1)[Linux] behind an Application Gateway, it was working smoothly.
Although the problem is currently resolved after restarting the App Service, we would like to understand the possible root causes and recommendations to prevent it in the future.
Scenario:
- Architecture:
- Client → HTTPS custom domain → Application Gateway → Azure App Service → Streamlit app
- Symptom:
- While accessing the app via the HTTPS domain, the Streamlit page did not fully load.
- The issue occurred intermittently and was resolved immediately after restarting the App Service.
Observations:
- CPU and memory usage on the App Service were normal during the incident.
- App Service is configured with “Always On”, setting as ON so it does not go idle.
- Restarting the App Service immediately resolves the problem.
- Application Logs did not show any critical errors during the issue.
- No network issue at client's browser side.
- Application gateway logs does not have any issues.
Questions:
- What could be the likely root cause of this intermittent “stuck” behavior for a Streamlit app behind an Azure Application Gateway using HTTPS?
- Is it something like Transient network glitch between Application Gateway and App Service.
Additional information:
- This started from 3-Sept 9:00 am, 13:30 JST - Was any service outage etc. during this time,
We would greatly appreciate guidance or insights on this as this is critical and occurred on client's environment.
Thank you in advance!
Azure App Service
-
Anonymous
2025-09-05T07:10:25.48+00:00 Hi @Dcm
Thank you for posting your question on Microsoft Q&A.
From your description, it looks like your Streamlit application hosted on Azure App Service behind an Application Gateway intermittently stops responding, and the issue is resolved after restarting the App Service. You would like to understand the possible root causes and how to prevent this behavior in the future.
In order to investigate this further with our internal team, could you please share the following details in a private message?
- Subscription ID
- App Service name
- App URL
- Resource Group
- Resource ID
- Email address associated with the subscription
- Preferred communication email address
This information will help us review the issue more closely. For security reasons, please do not share these details publicly in the thread.
You can also review the following documentation which provides guidance on troubleshooting App Service availability and performance issues: https://learn.microsoft.com/en-gb/azure/app-service/troubleshoot-diagnostic-logs
Feel free to post back if you have any further questions or need additional clarification.
-
Dcm • 20 Reputation points
2025-09-05T08:42:17.28+00:00 Hi Vimal,
Thank you for response and sharing details.
How do I send personal message to you ?
if you provide email-id for communication this will really help. -
Dcm • 20 Reputation points
2025-09-08T01:20:16.86+00:00 Hi Vimal Lalani
Can you please update on this as this occurred on our customer's production environment. -
Anonymous
2025-09-08T10:01:57.97+00:00 Hi @Dcm,
Could you please share the information I was asked in the private chat then it could be helpful to further investigation. -
Dcm • 20 Reputation points
2025-09-09T00:06:37.83+00:00 Hi RAMAMURTHY MAKARAPU
Let me know, how to do private chat as I can't find option on this page.
Or
Share me your email address for communication. -
Anonymous
2025-09-11T08:00:12.0166667+00:00 Hi Dcm
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others. Otherwise, will respond with more details and we will try to help.
-
Anonymous
2025-09-11T10:44:31.1266667+00:00 Hi Dcm
Thank you for posting your question on the Microsoft Q&A forum.
Based on your description, it seems that the Health Check feature in Azure App Service is not enabled. The Health Check feature helps improve availability by automatically removing unhealthy instances from rotation.
This feature works by pinging a specified health check path on all instances of your web app every minute. If an instance does not respond or responds with a failure for the configured number of attempts (by default, 10 minutes, defined by the
WEBSITE_HEALTHCHECK_MAXPINGFAILURESsetting), that instance is marked as unhealthy, and Azure App Service will stop routing traffic to it.For production workloads, it is strongly recommended to configure the Health Check feature. This can help minimize potential downtime that may occur due to a faulty instance and ensure more reliable operation of your application.
You can find detailed guidance in the official documentation here: Monitor App Service instances using Health check
-
Dcm • 20 Reputation points
2025-09-12T07:58:33.7966667+00:00 Hi Vimal Lalani
Thank you for sharing details, we will add Health Check feature in Azure App Service.
Please help us investigate root cause of the issue, I have shared details yesterday about resources used in private chat. -
Anonymous
2025-09-12T12:43:28.73+00:00 Hi Dcm
A likely cause of the intermittent “stuck” behavior is that the app is running on an App Service Plan that isn’t optimized for production workloads. Lower-tier SKUs (Free, Shared, or Basic) share infrastructure and can experience resource contention, which may result in intermittent slowness or unresponsiveness. For production scenarios, it’s recommended to run the app on Standard, Premium, or Isolated App Service Plans, which provide dedicated resources, better performance, and stronger isolation from noisy neighbors.
In addition, make sure health probes are properly enabled and configured on the Azure Application Gateway for your App Service. The probes continuously monitor the health of your App Service instances. If an instance stops responding (for example, due to a transient glitch or resource exhaustion), the gateway marks it as unhealthy and automatically routes traffic only to the healthy instances. This prevents users from being sent to a “stuck” instance and reduces the likelihood of intermittent failures.
-
Anonymous
2025-09-15T07:39:41.57+00:00 Hi Dcm
Just checking in to see if above information was helpful. If you have any further updates on this issue
-
Dcm • 20 Reputation points
2025-09-16T09:04:59.9833333+00:00 Hi Vimal Lalani
Thank you for sharing details.
So cause is App Service Plan (B3) that isn’t optimized for production workloads
Could you recommend which plan to use as per as per users count and cost effective point of view, currently we have B3 plan.E.g. users count < 100 then use Standard S3, users count is between 100 to 200 then Premium v3 P2V3 something like that.
-
Anonymous
2025-09-16T09:15:31.53+00:00 Hi Dcm
In general, scaling should be based on application workload (CPU, memory, I/O, network), not just the number of users, since user activity patterns vary. However, as a rough guideline you can consider:
Standard (S1–S3): Best for small production workloads, light to moderate traffic.
Premium v2/v3 (P1v2, P2v3, etc.): Recommended for medium to large production workloads, improved performance, advanced scaling, and VNET integration.
Isolated (I1–I3): For high-security, compliance, or enterprise workloads requiring isolation.
Instead of mapping plans directly to user counts, monitor App Service metrics (CPU %, memory, HTTP queue length, response time) and scale up/down accordingly.
Azure also supports autoscaling, which helps manage cost-effectiveness while ensuring performance.
-
Dcm • 20 Reputation points
2025-09-16T09:30:00.91+00:00 Hi Vimal Lalani
Thank you for response.Q#1:
So to summarize below are two recommendations.- Upgrade App service plan
- Use multiple app service instances (auto-scale)
Is this correct ?
Q#2 : Regarding "Health probes are properly enabled and configured" --> With single app service, we have below configuration (PFB screenshot) , I hope this is properly configurated ?
Let us know, if any changes/recommendation if we use only single app service. -
Anonymous
2025-09-16T10:02:13.1966667+00:00 Yes, it's look correct, Dcm
Kindly ensure that the probe path returns a healthy HTTP 200 response.
-
Dcm • 20 Reputation points
2025-09-16T10:36:40.98+00:00 Hi Vimal Lalani
Thank you for response.
We checked HTTP 200 as below
I hope this is fine ?
-
Bipin Kadam • 60 Reputation points
2025-11-04T10:02:44.2366667+00:00 Hi Vimal Lalani
Thank you everyone for your guidance and suggestions. (I am replying from another individual account.)We upgraded our App Service plan from B3 to S3, and the application ran fine for the first 4–5 days. However, we are now facing the same issue again — the application does not load and only shows a blank screen, exactly as described in the original post.We checked the application logs, but there are no errors reported.
Memory usage: ~1.4 to 1.5 GB (Note: S3 supports up to 7 GB)
This issue is affecting our production environment, so any further help or insight will be greatly appreciated.
Thank you in advance for your support.
-
Anonymous
2025-11-04T11:28:36.1966667+00:00 Hi @Bipin Kadam / @Dcm
Could you please share web app name & web app url on private message ?
-
Bipin Kadam • 60 Reputation points
2025-11-04T13:45:07.5433333+00:00 Could you please share web app name & web app url on private message ?
--> Hi Vimal Lalani, Can you tell me, how to share this on private message as this is my new id, can't find any option.
-
Anonymous
2025-11-05T02:37:31.94+00:00 Hi @Bipin Kadam ,
At the top of this thread, you can find a private message like the one shown in the image. I will send you the message, and you can reply to it.
-
Bipin Kadam • 60 Reputation points
2025-11-05T04:06:44.9833333+00:00 Hi Vimal Lalani,
Thank you for response.
Might be because of my login-id has changed, I can't see the "Private messages" now.
Is there anything can be done ?
-
Anonymous
2025-11-05T08:23:46.4333333+00:00 Hi @Bipin Kadam
I recommend posting a new question on the forum with new account, if you’re unable to access your DCM account, as we may need to communicate via private messages in the future. Once you create the new post, please share its link here in a public comment so others can reference it as well.
-
Dcm • 20 Reputation points
2025-11-05T08:36:02.3133333+00:00 Hi Vimal Lalani,
I am able to old account and shared the required details on private message. -
Bipin Kadam • 60 Reputation points
2025-11-06T09:04:28.6933333+00:00 Hi Vimal Lalani
Thank you so much for response.
As per your hint about CPU usage, we have drilled down from when this issue occured.
Please find below more details. Application got stuck on 4-Nov-2025 approx. from 11 am to 4 pm JST. We checked Process full list for this app service from Azure Portal at the time of 4-Nov-2025 approx. 4pm JST. [UTC time: 2025-11-04T06:58:00]After that manually we restarted the approx. between 6:40 to 7 pm JST and then it started working.
CPU Usage
- Python process (
PID 2199359):
%CPU = 100.0% → Using 1 full vCPU.
- Total CPU capacity (vCPU) = 4 × 100% = 400%
Remaining CPU = 400 − 100 = 300% → ~3 vCPUs free
Even though the main Python process is using ~1 vCPU (%CPU ~100) and the S3 instance has 4 vCPUs in total—leaving ~3 vCPUs free— Why is the application still experiencing stuck behavior for few hours ?
Could you help pinpoint the cause, considering most other processes are idle and memory usage is moderate?
Please also recommend Should we try some different settings for app service e.g. different plan or other region etc. ?
- Python process (
-
-
Dcm • 20 Reputation points
2025-11-10T05:58:36.3366667+00:00 Hi Vimal Lalani
We experienced the same issue in the production environment today. Kindly provide an update and assist in identifying the root cause. Our primary concern at this stage is understanding the initial cause of the problem. -
Dcm • 20 Reputation points
2025-11-12T02:48:56.3466667+00:00 Hi Vimal Lalani
Could you please provide an update and assist in identifying the root cause.
Thank you. -
Dcm • 20 Reputation points
2025-11-19T07:06:36.4433333+00:00 Hi RAMAMURTHY MAKARAPU •Vimal Lalani
We are still facing issue on production.Can you please give us assist in identifying the root cause.
-
Shree Hima Bindu Maganti • 7,590 Reputation points • Microsoft External Staff • Moderator
2025-11-24T04:48:29.9566667+00:00 Hi @Dcm
Apology for delay response.
We reviewed your App Service instance using our internal diagnostics, and it shows that the Health Check feature is currently not enabled, and your application is running on only one worker. When Health Check is disabled, the platform cannot detect if the application becomes unresponsive due to a long-running Python/Streamlit process or a blocked request thread. As a result, even if the instance becomes unhealthy or stuck, Azure continues routing traffic to it, leading to the blank screen and intermittent loading issues you are experiencing. Enabling Health Check allows Azure to automatically monitor your application’s health endpoint every minute and remove the instance from rotation if it stops responding, which significantly reduces downtime and “stuck” scenarios. We strongly recommend enabling Health Check with a valid health endpoint and also considering running more than one instance for production workloads to avoid single-instance failures.
https://learn.microsoft.com/en-us/azure/app-service/monitor-instances-health-check?tabs=dotnet
Let me know if you have any further assistances needed. -
Dcm • 20 Reputation points
2025-11-24T13:21:26.3933333+00:00 Hi Shree Hima Bindu Maganti
Thank you very much for your response.We reviewed your App Service instance using our internal diagnostics, and it shows that the Health Check feature is currently not enabled, and your application is running on only one worker.
Currently, our application is designed to run on a single instance. Supporting multiple instances would require significant changes.
Question#1 : With the current implementation, if we ensure that a health check endpoint (e.g.,
/custom_health_check) correctly returns the application’s status, will Azure automatically replace the instance when it becomes unresponsive, even if we continue using a single instance? As per current documentation, I can see it's not possible.Question#2 : For a single instance only, do you have any recommendations to avoid long-running processes, for example, restarting the app daily? Currently only after restart stuck issue is getting resolved.
Question#3 : By any chance whether this is stuck issue due S3 plan, in other words if we go with premium plan then will this stuck issue gets resolved ?
-
Dcm • 20 Reputation points
2025-11-28T01:42:42.6633333+00:00 Hi **Shree Hima Bindu Maganti
**Could you please reply on above questions. -
Shree Hima Bindu Maganti • 7,590 Reputation points • Microsoft External Staff • Moderator
2025-12-01T07:14:52.11+00:00 Hi @Dcm
Thank you for your follow-up questions. To clarify, enabling a Health Check endpoint on a single-instance App Service will allow Azure to detect when the application becomes unhealthy, but it cannot automatically restart or replace that same instance, because Health Check only removes unhealthy instances from a load-balanced pool and a single instance has no backup node to fail over to. For single-instance architectures like yours, the most effective mitigation is to reduce the chance of long-running or blocking operations inside the Streamlit/Python processfor example, scheduling a daily restart, offloading heavy processing to background services, and ensuring Streamlit callbacks do not block the main thread. Upgrading from S3 to a Premium plan can provide more CPU, memory throughput, and overall stability, but it will not eliminate the “stuck” behavior if the underlying issue is a blocked Python worker, since Streamlit itself is single-threaded and can freeze even on larger SKUs. Therefore, while upgrading may improve performance, the stuck behavior will still require either architectural changes to support multiple instances or operational mitigations such as scheduled restarts and optimized workload handling.
Let me know if you have any further assisstences needed.
Sign in to comment