Troubleshooting Your AppService Deployment

This is step 6 of 6 of Hands-On Project 4 for Azure. In this step, we look briefly at how to remedy a few common deployment problems, and how you can obtain information you can use to determine the cause of production problems.

Back to Project

Problems Deploying from Visual Studio Code

Occasionally when deploying to the App Service from VS Code, there is a problem in populating the production runtime container with all the needed dependencies. This does not always happen, but it could happen to your deployment. If your site is completely unaccessible (i.e. you can’t even display the home page), you can try adding two application settings that will force a rebuild of your Python environment at deployment time. Add these settings to your application settings for the App Service:

Database Connection Problems

If you are able to display the site’s home page but the application hangs when you try to access the database, there might be errors in your application settings for the database. If you have this problem, please try the following:

  1. Double-check your App Service application settings to make sure the database parameters are correct. The relevant settings are SF_DB_NAME, SF_HOSTNAME, SF_PASSWORD, SF_PORT, and SF_USERNAME.
  2. Double-check that you configured the database server to allow unencrypted connections. See the post for Step 2 of this project for details.

Viewing Application Logs

For many routine problems, you can find clues in the App Service Application logs. To access the log files, navigate to Diagnose and solve problems, then select Application Logs. The most recent log messages will be displayed. There are several logs available, and you can download the full log files to see a more complete picture of what has been going on in your server. Here is a screenshot of the initial log display: