Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Deploy Windows Container to Azure App Service

Steve Smith edited this page May 31, 2019 · 11 revisions

Overview

Azure Web App for Containers provides a very simple way to deploy containerized applications on Windows (or Linux). This fully-managed platform eases infrastructure maintenance and supports built-in auto scaling and load balancing.

Goals for this walkthrough

This walkthrough shows you how to create a new Azure Web App for Containers and how to deploy eShopModernizing apps into this new app service.

Instructions

First, you'll need an Azure account. Create a free account now if necessary. Next, create an Azure App Services Web App. In the Azure Portal, add a new "App Services" resource (you can search for this term in the add dialog). Fill out the form as shown here:

image

  • Choose your subscription and a resource group (create a new one if desired)
  • Give the app a unique name (with an available URL)
  • Choose 'Docker Image' for the Publish option
  • Make sure to choose Windows for the Operating System
  • Choose an App Service Plan that will accommodate your app (it should be at least the PC3 size)

Note: In order to use a Windows Container for an eShopModernizing app you'll need to select at least a PC3 option. This app includes the SQL Server container image, which alone is about 15 GB, and also includes the ASP.NET container image, which is about 14 GB. The PC2 option has a maximum total size of 19 GB, and will result in an error if it is used.

Click 'Next: Docker >`.

image

Configure Docker as follows:

  • Image Source: Docker Hub
  • Access Type: Public
  • Image and tag: eshop/modernizedmvc:master

Click 'Review and Create'.

image

Review the options, which should be similar to those shown in the image above.

Click 'Create'. The deployment will commence, and in a few moments you should see a confirmation that the container is deployed and starting up.

image

Click 'Go to resource' and you'll be taken to the resource's overview in the Azure Portal.

image

Click 'Browse' to navigate to the site. It may still be starting, in which case you'll see a screen like this one:

image

To review the app's configuration and its current status, click on Container settings in the Azure Portal for the app service:

image

Refresh and scroll down through the logs to see the progress as the container is downloaded and configured. Also, turn on Continuous Deployment if you'd like to have the container automatically updated any time a new version is published to the registry. Here you can see CD is enabled, and Azure is successfully swapping the new container with the old one, as noted in the logs:

image

Once the app is up and running, you should see something like this:

image

WebForms and WCF App Instructions

The instructions for publishing the modernized Web Forms and WCF applications are similar to those shown above for the ModernizedMVC app. The most important difference is obviously the name of the image to use. When you configure Docker's Image and tag setting, use eshop/modernizedwebforms:master for Web Forms and eshop/wcfservice:master for the WCF service (that the Windows Forms application communicates with over HTTP).

Once deployed, the modernized Web Forms app should look like this:

image

and the WCF Service should look like this (navigate to /CatalogService.svc):

image

Clone this wiki locally