Deploy to Azure App Service on Linux
This tutorial walks you through using Visual Studio Code to deploy a Python application to Azure App Service on Linux using the Azure App Service extension.
If you encounter issues with any of the steps in this tutorial, we'd love to hear the details. Use the I ran into an issue link at the end of each article to submit feedback.
Azure App Service on Linux, currently in Preview for Python, runs your source code in a pre-defined Docker container. That container runs apps with Python 3.7 using the Gunicorn web server. The characteristics of this container are described on Configure Python apps for App Service on Linux. The container definition itself is on the github.com/Azure-App-Service/python.
- An Azure subscription.
- Visual Studio Code with the Azure App Service extension.
- A Python environment
If you don't have an Azure subscription, sign up now for a free account with $200 in Azure credits to try out any combination of services.
Visual Studio Code, Python, and the Azure App Service extension
Install the following software:
- Visual Studio Code.
- Python and the Python extension as described on VS Code Python Tutorial - Prerequisites.
- The Azure App Service extension, which provides interaction with Azure App Service from within VS Code. For general information, explore the App Service extension tutorial and visit the vscode-azureappservice GitHub repository.
Sign in to Azure
Once you've installed the Azure extension, sign into your Azure account by navigating to the Azure: App Service explorer, select Sign in to Azure, and follow the prompts.
After signing in, verify that the email address of your Azure account appears in the Status Bar and your subscription(s) appears in the Azure: App Service explorer:
If you see the error "Cannot find subscription with name [subscription ID]", this may be because you are behind a proxy and unable to reach the Azure API. Configure
HTTPS_PROXY environment variables with your proxy information in your terminal:
# macOS/Linux export HTTPS_PROXY=https://username:password@proxy:8080 export HTTP_PROXY=http://username:password@proxy:8080 # Windows set HTTPS_PROXY=https://username:password@proxy:8080 set HTTP_PROXY=http://username:password@proxy:8080