Tutorial: Deploy Docker containers to Azure App Service with Visual Studio Code
This article walks you through the process of using Visual Studio Code to deploy a container image from a container registry to Azure App Service.
If you encounter issues with any of the steps in this tutorial, we'd love to hear the details. Use the This page feedback button at the end of each article.
For a related demonstration video, see Django Apps in VS Code dev containers (youtube.com) from virtual PyCon 2020.
Configure your environment
- An Azure account
- Visual Studio Code
- A suitable container that's been uploaded to a container registry. Details on creating a container with a Python web app can be found on Python in containers.
- The Azure App Service extension for VS Code.
- The Docker extension for VS Code.
Sign in to Azure
Once you've installed the Azure extension, sign into your Azure account by navigating to the Azure explorer, select Sign in to Azure, and follow the prompts. (If you have multiple Azure extensions installed, select the one for the area in which you're working, such as App Service, Functions, etc.)
After signing in, verify that Azure: Signed In" appears in the Status Bar and your subscription(s) appears in the Azure 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:
# Windows set HTTPS_PROXY=https://username:password@proxy:8080 set HTTP_PROXY=http://username:password@proxy:8080
# macOS/Linux export HTTPS_PROXY=https://username:password@proxy:8080 export HTTP_PROXY=http://username:password@proxy:8080