Share via

504.0 Gateway Timeout

fceci90 0 Reputation points
2026-05-29T16:02:07.9433333+00:00

ASP.NET 10 Blazor SSR website on Azure Linux App Service B1 plan.
On 5/13 I updated my website and published and it resulted in a gateway timeout. I have since:

  1. Reverted back to old Program.cs and republished
  2. Deleted and recreated new web app and republished
  3. Spent countless hours trying to look through logs and publishing with console logs to figure out the issue (inconsistent every time even when nothing changed but republishing which makes zero sense)
  4. Created a temporary Windows App Service plan (B1 tier) to see if it was my code (this worked right away)
  5. Created a site on a Windows Server 2019 machine hosted on IIS and published there and it works right away.
  6. Created a new branch based on code from before 5/13 and republished and it still doesn't work.

I have spent two weeks and countless hours trying to figure out why this site no longer works on my Linux app service plan. The container keeps timing out and after 230 seconds shuts down. I cannot figure out why. I did notice, even with a very basic one page "static" Razor pages .NET 10 site it takes a very long time (five minutes or so) for the app to publish and be accessible publicly again. Perhaps since this particular site is larger it takes too long? But this site is pretty small so that doesn't make sense to me. Please help.

Thanks,
Frank

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


1 answer

Sort by: Most helpful
  1. Sina Salam 29,516 Reputation points Volunteer Moderator
    2026-05-29T18:17:49.2433333+00:00

    Hello fceci90,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that your ASP.NET 10 Blazor SSR site on Azure Linux App Service B1 is failing with 504.0 Gateway Timeout after deployment, while the same application works immediately on Windows App Service and Windows Server IIS.

    This is caused by the Azure Linux App Service container not becoming ready within the platform startup/response window, not by Blazor SSR code itself. This is strongly supported by the fact that the same code works on Windows, but the Linux App Service container waits around 230 seconds and then shuts down. Azure App Service has a platform timeout when the application does not return a timely response, and Linux App Service requires the deployed .NET app to start correctly from the compiled application output. - https://ruslany.net/2019/06/azure-app-service-deployment-slots-tips-and-tricks/, https://appservicesperformance.github.io/2023/05/26/arraffinity/

    The best practice for resolution is to:

    • Confirm that the Linux App Service is actually using the supported .NET 10 runtime.
    • Set the Linux startup command explicitly to the deployed application DLL.
    • Ensure Kestrel listens on the expected Linux container HTTP port.
    • Enable App Service logs and check the Linux container startup logs.
    • If the Linux runtime path remains unstable, temporarily run the app on Windows App Service or publish the app as a self-contained Linux x64 deployment.

    After correcting the Linux runtime, startup command, and port binding, the container should respond to the App Service startup probe and the 504.0 Gateway Timeout should stop.

    Use the below resources for more reading, validation and steps:

    I hope this is helpful! Do not hesitate to let me know if you have any other questions, steps or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.