How to fix "Hey, Python developers! Your app service is up and running. Time to take the next step and deploy your code." After successful deployment in Azure

Mahin M 0 Reputation points
2024-01-22T14:24:56.7166667+00:00

I successfullu deployed my Fastapi app in Azure.. But I get the above message intead of my API page

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

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,301 Reputation points Moderator
    2024-01-29T23:02:43.7533333+00:00

    Hello @Mahin M

    Here are a few things you can try to resolve your issue:

    • Make sure your app code is actually deployed to App Service. Go to the Kudu console (https://<your-app-name>.scm.azurewebsites.net) and check if your code is in the site/wwwroot folder.
    • Check the web.config file in wwwroot. Make sure it is configured to point to your FastAPI's main module and WSGI app object. For example:
    <configuration>  
      <appSettings>  
        <add key="PYTHONPATH" value="." />  
        <add key="WSGI_HANDLER" value="app.main:app" />  
        <add key="WSGI_LOG" value="D:\home\LogFiles\wfastcgi.log" />  
      </appSettings>  
    </configuration>  
    
    • Verify your main FastAPI file (e.g. main.py) has the if __name__ == "__main__": block with uvicorn.run() to start the server. This is required for Azure App Service.
    • Check the Azure App Service logs in LogFiles folder for any errors.
    • Try restarting the App Service after deploying code changes.
    • Make sure the FastAPI app is listening on port defined in the PORT environment variable, not a hardcoded port.
    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.