Error on Deploying FastAPI application to Azure Web App service.

Deepesh Kalura 0 Reputation points
2024-02-08T19:55:50.5466667+00:00

After completing the code i tries to deploy my fastapi app in azure and it is failing deployment from last 3 days. I still don't know what is error. So, i need help what is the error. So, my app get successfully deploy. User's image

Overview of the web app service User's image

Source Code link if need any logs just ask e

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,501 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 28,116 Reputation points Microsoft Employee
    2024-02-09T10:05:14.5533333+00:00

    @Deepesh Kalura, based on the info you have shared; I see that your webapp Healix-backend.azurewebsites.net shows - HTTP 504 error, which usually indicates timeout.

    Checking internally, I see that most of the HTTP 504 are failing after 240 seconds.  User's image

    Azure Load Balancer has a default idle timeout setting of four minutes, it is the maximum amount of time that a request can take without sending any data back to the response. It is not configurable.   Kindly checkout the following approaches to overcome this issue:

    A. Optimize code to finish execution within 240 seconds or send some data back at regular intervals to keep the connection alive.

    B.  If sending data back to keep connection alive is not feasible, consider using async pattern.

    That is:

    • First request starts with the script and returns an HTTP 202
    • Subsequent requests from clients check the progress, and eventually return 200 when it's done.

    C: Leverage background processing for long running tasks.

    Please checkout this example: Azure Web Jobs   

    FAQ: Why does my request time out after 230 seconds?
    https://learn.microsoft.com/troubleshoot/azure/app-service/web-apps-performance-faqs#why-does-my-request-time-out-after-230-seconds    

      It looks like Always On is not enabled.

    1. Please enable it from Azure Portal – Your WebApp > Configuration blade (> General settings).

     To fetch more details about the issue, you may try these:

    3.     You may leverage App Service diagnostics from Azure Portal> Navigate to your App Service app in the Azure Portal -to fetch more info
    https://learn.microsoft.com/azure/app-service/overview-diagnostics

     

    4.   If the issue still persists, by default, if your container does not respond after 230 seconds, it will time out. (This time out can be increased by with the WEBSITES_CONTAINER_START_TIME_LIMIT app setting.) (up to a maximum of 1800)

    Kindly let us know, I'll follow-up with you further.

    0 comments No comments

Your answer

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