Hello everyone,
so i am creating a portal wich need authentification to get access, in preview mode i can't login in to see changes. the button sign in (in french se connecter) is not responding !
thank you in advance for any clarification.
Thank you for your detailed feedback and the code snippet—you've clearly put a lot of thought and effort into troubleshooting.
Since your app is running on Linux App Service and you've disabled Application Insights, eliminated caching and buffering at multiple levels (including APIM), and can reproduce the issue even when calling the service directly, this narrows down causes significantly.
Your observation that the first SSE request after restarting works perfectly, but subsequent requests have delivery issues (despite heartbeats arriving) strongly suggests a long-lived connection or socket reuse problem on the App Service platform or possibly connection pool exhaustion.
Some additional suggestions to consider:
Connection limits: Check if your App Service plan has connection limits or throttle settings that impact concurrent SSE connections.
Keep-alive handling: While your headers look correct, ensure your reverse proxies or environment (including Kestrel) are configured to respect "Connection: keep-alive" without prematurely closing sockets.
Resource Cleanup: Ensure the prior SSE connections are disposed properly by the client and server to free resources before new ones are made.
Logging Network Traffic: Try capturing network-level logs (tcpdump, wireshark) or use Azure Network Watcher to see if packets are delayed or dropped after the first connection.
Alternative Streaming: Consider using WebSockets or SignalR for persistent bi-directional communication if SSE proves unreliable in your environment.
Your code snippet looks fine and aligns with SSE best practices on ASP.NET Core/Linux. Sometimes platform-specific limitations or intermediaries cause silent failures, which are tricky to debug.
If you can't identify socket exhaustion or network drops, consider opening a support case with Azure, referencing your investigation and the minimal repro. Let me know if you want help with WebSocket or SignalR approaches as alternatives.
Best Regards,
Jerald Felix
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.