504.0 Gateway Timeout

fceci90 25 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.


Answer accepted by question author

Sina Salam 30,816 Reputation points Volunteer Moderator
2026-05-30T17:02:50.9933333+00:00

Hello fceci90,

Follow, I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!

Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer. Accepted answers show up at the top, resulting in improved discoverability for others.

Issue:

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.

Error Message:

NIL

Solution:

Customer @fceci90 upgraded from B1 plan to the B2 plan to publish and the plan going forward is to Scale up manually, publish, test site, scale down manually.

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?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. fceci90 25 Reputation points
    2026-05-30T00:45:35.28+00:00

    Well none of this did it for me, but I tried something that seemed somewhat obvious, but I couldn't think it would work... I upgraded to the B2 plan to publish. So the B1 level of Linux app service is too slow to publish a site? The description says it can handle low traffic production sites. Well my site has 0 traffic, and is pretty basic, so I find this hard to believe. I guess running 5 sites oversaturates the 1 vCore and 1.75GB of memory? The other 4 sites are all super basic and have little to no traffic. Perhaps there should be better guidelines to the capabilities of app service plans? I've lost soo much sleep over these last two weeks trying to figure this out. I've tried and tested soo many different things I can't even remember anymore. I guess this will be the plan going forward. Scale up manually, publish, test site, scale down manually.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Sina Salam 30,816 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.