Deploy a custom Linux container to Azure App Service

App Service on Linux provides pre-defined application stacks on Linux with support for languages such as .NET, PHP, Node.js and others. You can also use a custom Docker image to run your web app on an application stack that is not already defined in Azure. This quickstart shows you how to deploy an image from an Azure Container Registry (ACR) to App Service.


Create an image

To complete this quickstart, you will need a suitable web app image stored in an Azure Container Registry. Follow the instructions in Quickstart: Create a private container registry using the Azure portal, but use the image instead of the hello-world image. For reference, the sample Dockerfile is found in Azure Samples repo.


Be sure to set the Admin User option to Enable when you create the container registry. You can also set it from the Access keys section of your registry page in the Azure portal. This setting is required for App Service access.

Sign in

Next, launch VS Code and log into your Azure account using the App Service extension. To do this, select the Azure logo in the Activity Bar, navigate to the APP SERVICE explorer, then select Sign in to Azure and follow the instructions.

sign in to Azure

Check prerequisites

Now you can check whether you have all the prerequisites installed and configured properly.

In VS Code, you should see your Azure email address in the Status Bar and your subscription in the APP SERVICE explorer.

Next, verify that you have Docker installed and running. The following command will display the Docker version if it is running.

docker --version

Finally, ensure that your Azure Container Registry is connected. To do this, select the Docker logo in the Activity Bar, then navigate to REGISTRIES.


Deploy the image to Azure App Service

Now that everything is configured, you can deploy your image to Azure App Service directly from the Docker extension explorer.

Find the image under the Registries node in the DOCKER explorer, and expand it to show its tags. Right-click a tag and then select Deploy Image to Azure App Service.

From here, follow the prompts to choose a subscription, a globally unique app name, a Resource Group, and an App Service Plan. Choose B1 Basic for the pricing tier, and a region.

After deployment, your app is available at http://<app name>

A Resource Group is a named collection of all your application's resources in Azure. For example, a Resource Group can contain a reference to a website, a database, and an Azure Function.

An App Service Plan defines the physical resources that will be used to host your website. This quickstart uses a Basic hosting plan on Linux infrastructure, which means the site will be hosted on a Linux machine alongside other websites. If you start with the Basic plan, you can use the Azure portal to scale up so that yours is the only site running on a machine.

Browse the website

The Output panel will open during deployment to indicate the status of the operation. When the operation completes, find the app you created in the APP SERVICE explorer, right-click it, then select Browse Website to open the site in your browser.

Next steps

Congratulations, you've successfully completed this quickstart!

Next, check out the other Azure extensions.

Or get them all by installing the Azure Tools extension pack.