• This repository has been archived on 07/May/2024
  • Stars
    star
    920
  • Rank 49,655 (Top 1.0 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Modernizing existing .NET Framework, hypothetically legacy backoffice eShop web apps (traditional ASP.NET WebForms and MVC) with Windows Containers and Azure Cloud

eShopModernizing - Modernizing ASP.NET Web apps (MVC and WebForms) and N-Tier apps (WCF + WinForms) with Windows Containers and Azure

This repo provides three sample hypothetical legacy eShop web apps (traditional ASP.NET WebForms and MVC in .NET Framework and an N-Tier app based on a WCF service and a client WinForms desktop app) and how you can modernize them (Lift and Shift scenario) with Windows Containers and Azure Cloud into the following deployment options:

  • Local build and deployment in dev PC with Visual Studio and Docker for Windows
  • Azure Container Instances (ACI)
  • Regular Windows Server 2016 VM (Virtual Machine)
  • AKS Kubernetes orchestrator cluster
  • Azure Web App for Containers (Windows Containers)

All those mentioned environments can be deployed into Azure cloud (as explained in the Wiki) but you can also deploy all those environments into on-premises servers or even in other public clouds.

Related Guide/eBook

You can download its related guidance with this free guide/eBook (2nd Edition):

.PDF download: https://aka.ms/liftandshiftwithcontainersebook

The modernization with Windows Containers significantly improves the deployments for DevOps, without having to change the app's architecture or C# code.

The sample apps are simple web apps for the internal backoffice of an eShop so employees can update the Product Catalog. Both apps are therefore simple CRUD web application to update data into a SQL Server database.

See a screenshots of both apps below.

INITIAL VERSIONS OF EXISTING ASP.NET WEB APPS

image

CONTAINERIZED VERSION IN DEVELOPMENT ENVIRONMENT

image

UI and business features

The WebFoms and MVC apps are pretty similiar in regards UI and business features. We just created both versions so you can compare, depending on what technology you are using for your existing apps (ASP.NET MVC or Web Forms).

image

Winforms + WCF Application

The winforms application is a catalog management, and uses a WCF as a back-end. Read more about the Winforms + WCF sample here

DEPLOYMENT TO AZURE CONTAINER INSTANCES

image

DEPLOYMENT TO AZURE WINDOWS SERVER 2016 VM

image

DEPLOYMENT TO KUBERNETES CLUSTER IN AKS (Azure Kubernetes Service)

image

DEPLOYMENT TO AZURE WEB APP FOR CONTAINERS

image

Quick start: Running all apps together in your local Windows 10 PC with "Docker for Windows"

You have more detailed procedures at the Wiki, but for the quickest way to get started and run all samples together using Docker for Windows, open a "Developer Command Prompt for VS 2017 (or 2019)" (to ensure you have right msbuild on PATH), go to the eShopModernizing root folder and run the build.cmd script.

Note: The current version uses netcoreapp3.0. You will need to instll the preview SDK and set Visual Studio to 'Use previews of the .NET Core SDK (under Options - Projects and Solutions - .NET Core).

This script will:

  • Build MVC project
  • Build Webforms project
  • Build WCF back-end project
  • Create three Docker images (Windows Container images):
    • eshop/modernizedwebforms
    • eshop/modernizedmvc
    • eshop/wcfservice

You can check the just created Docker images by running docker images from the command line:

image

Finally just run docker-compose up (in the root of the repo) to start all three projects and one SQL Server container. Once the containers are started:

  • MVC web app listens in:
    • Port 5115 on the Docker Host (PC) network card IP
    • Port 80 on the internal container's IP
  • Webforms web app listens in:
    • Port 5114 on the Docker Host (PC) network card IP
    • Port 80 on the internal container's IP
  • WCF service listens in port:
    • Port 5113 on the Docker Host (PC) network card IP
    • Port 80 on the internal container's IP

Note You should be able to use http://localhost:<port> to access the desired application.

In order to test the apps/containers from within the Docker host itself (the dev Windows PC) you need to use the internal IP (container's IP) to access the application. To find the internal IP, just type docker ps to find the container ids:

docker ps output

Then use the command docker inspect <CONTAINER-ID> -f {{.NetworkSettings.Networks.nat.IPAddress}} to find the container's IP, and use that IP and port 80 to access the container:

accessing-container

The localhost loopback limitation in Windows Containers Docker hosts

Due to a default NAT limitation in current versions of Windows (see https://blog.sixeyed.com/published-ports-on-windows-containers-dont-do-loopback/) you can't access your containers using localhost from the host computer. You have further information here, too: https://blogs.technet.microsoft.com/virtualization/2016/05/25/windows-nat-winnat-capabilities-and-limitations/

Although that limitation has been removed beginning with Build 17025 (as of early 2018, still only available today to Windows Insiders, not public/stable release). With that version (Windows 10 Build 17025 or later), access to published container ports via β€œlocalhost”/127.0.0.1 should be available.

Review the Wiki for detailed instructions on how to set it up and deploy to multiple environments

Wiki: https://github.com/dotnet-architecture/eShopModernizing/wiki

Choose in-memory mock-data or real database connection to a SQL Server database

The MVC and WebForms web apps allow either to connect to the real database to get/update the product catalog or to use mock-data if, due to any reason, the database is still not available and you need to test/demo the app.

For each application, the option to select one or the other mode can be configured in the docker-compose.override.yml file when using Windows Containers or at the Web.config file when you still are NOT using Containers (original versions).

More Repositories

1

eShopOnContainers

Cross-platform .NET sample microservices and container based application that runs on Linux Windows and macOS. Powered by .NET 7, Docker Containers and Azure Kubernetes Services. Supports Visual Studio, VS for Mac and CLI based environments with Docker CLI, dotnet CLI, VS Code or any other code editor. Moved to https://github.com/dotnet/eShop.
C#
24,535
star
2

eShopOnWeb

Sample ASP.NET Core 8.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder.
C#
10,161
star
3

eShopOnDapr

A sample .NET distributed application based on eShopOnContainers, powered by Dapr.
C#
1,530
star
4

News

News on .NET Architecture Guidance, eShopOnContainers and all the reference apps in dotnet-architecture
1,104
star
5

eBooks

.NET Architecture e-Books
1,102
star
6

eshop-mobile-client

eShop mobile & desktop client built with .NET MAUI
C#
534
star
7

eShopOnBlazor

Migration of a traditional ASP.NET Web Forms app to Blazor
JavaScript
503
star
8

HealthChecks

Experimental Health Checks for building services, such as with ASP.NET Core
C#
454
star
9

eShopOnContainersAI

eShopOnContainers with AI, ML and Bots features
JavaScript
407
star
10

PerformanceMonitor

.NET Core Application Performance Monitor
C#
236
star
11

eShopOnAzure

Azure version of the eShopOnContainers, with implementations based on Azure services.
C#
223
star
12

eShopOnUWP

Universal Windows Platform line of business application showcasing the latest Windows 10 capabilities such as Fluent Design System, Ink and Windows Hello.
C#
162
star
13

Messaging

.NET Core Application blocks for message-based communication
158
star
14

grpc-for-wcf-developers

gRPC for WCF Developers guidance samples
C#
135
star
15

MNISTTensorCNTK

C#
118
star
16

RecommendationEngine

Recommendation Engine using Azure ML Studio to recommend related movies.
C#
101
star
17

explore-docker

C#
8
star
18

.github

3
star