user

Migrating Webforms to Microservices

Introduction

Crista Perlton

Crista Perlton


LATEST POSTS

How Licenses Work with Chocolately 22nd March, 2024

How to Handle npm Dependencies with Lock Files 16th January, 2024

.NET

Migrating Webforms to Microservices

Posted on .

.NET 8 is now here and if you were looking for a sign to migrate your monolith applications to microservices this is it.

ASP.NET web forms are going away and there is no word of an official replacement from Microsoft. However, Microsoft does recommend IT organizations rewrite current ASP.NET web forms in Core Blazor or Razor. What that basically means is that a full rewrite is required if you’re interested in moving away from web forms.

The thing is, if you’re already doing a full rewrite, it actually makes much more sense to move away from monolithic applications and migrate to microservices using Blazor/Razor.

Monolith vs. Microservice – David vs. Goliath

ASP.NET Web Forms are generally released in a “traditional” software release where an application is released as a unified, single, usually humungous entity (thus the name monoliths.) There are benefits to this method, like development and deployment simplicity. However, maintenance and updates are slow and difficult.

The opposite of your monolithic ASP.NET web forms is microservices and micro-applications built through Blazor/Razor.

Everyone knows the term “microservices” but is unlikely to define it the same way. Often, though, people mean “modularized development.” Modularized development, as the name suggests, is developing separate “modules” for discreet parts of your application or code. Just as your cell phone has totally separate applications for messaging and the camera, your IT systems can remain an integrated application while being modularized inside.

Sounds great, right? But as the saying goes, Rome wasn’t built in a day – and transitioning to microservices is not a trivial task; it will take time, effort, and resources. But with the right automation tools in place, microservices are just as easy to develop and deploy as monoliths but are much easier to maintain and update at speed.

.NET5+ (.NET 5 to .NET 8) has an unprecedented release cadence for Microsoft. Each new .NET will come within just one year of the last major version and the long-term support period will be only three years. We all know how the story goes. David slayed Goliath and (in my opinion) microservices slay monoliths. To keep up with the pace that .NET5+ and Microsoft are setting, you will need to be agile and responsive and that pace just isn’t possible if you’re working with a single, giant application.

While “traditional” Web Forms will remain available as long as .NET Framework is supported, it would be unwise to (re)write new applications to target this aging technology. Modularizing your applications to target .NET5+ means you have smaller system pieces, which are simpler to update. Migrating to microservices is the best way to get the benefits .NET5+ offers.

So What Should I Do?

Start planning your migration to microservices using Blazor and Razor.

Modularizing Web Forms applications for .NET5+ will be complex but very worth the effort. Unlike Web Forms, whose code is entangled in the .NET Framework itself, MVC and Blazor work with .NET5+, rather than as a core part of it.

The good news is, there’s no rush to do this today. You have time to properly plan this out and build your microservices while still utilizing and maintaining your monoliths.

How Hard Can It Be?

That’s a difficult question to answer. How difficult is cooking? All you need to do is chop some food and apply heat, right?

The biggest hurdle you and many other IT organizations will face in this migration is not necessarily the re-writing – but more the re-learning. You and your team are a well-oiled IT machine. Chances are you have a (combined) century’s worth of experience working with Web Forms at a much slower cadence.

Switching to Blazor or Razor requires your team to re-learn a whole new style of the development pipeline.

The great news is with the right tool, much of this stress can be reduced through automation. BuildMaster pipelines let you build a repeatable release process by defining the servers and environments that your builds will be deployed to, as well as the manual and automatic approvals required at each stage of the process.

A basic web application might use a pipeline with only two stages (testing and production), and simply deploy to a different folder on the same server. Another application may require a dozen stages, each with multiple targets that go to different environments, and all sorts of automatic and human approvals to meet compliance requirements.

An added bonus of using BuildMaster is that it will also work with your current monoliths. What that means is that you get the best of both worlds. Your IT organization is able to keep your web forms for a bit longer while smoothly and efficiently transitioning to microservices.

Next Steps

.NET 8 is now here and the age of ASP.NET web forms is slowly coming to an end. This means that in one way or another, your IT organization is going to have to make some changes.

Microsoft is moving towards a much more agile cadence. If you want to have any chance of keeping up in the long term, migrating your monolithic Web Forms to microservices with Blazor and Razor is necessary.

With any big shift in technology, there are growing pains. But using build-automation tools like BuildMaster will seriously reduce those pains and allow your organization the comfort of the old while transitioning to the new.

Crista Perlton

Crista Perlton

Navigation