dotnet / systemweb-adapters

MIT License
340 stars 61 forks source link

Legacy Migration with Yarp and Azure Deployment #544

Open Wraith2 opened 2 months ago

Wraith2 commented 2 months ago

In the article https://devblogs.microsoft.com/dotnet/incremental-asp-net-to-asp-net-core-migration/ the adapters in this repository and Yarp are used to provide an upgrade path from a monolithic legacy application towards modern runtimes. This is useful but I'm finding it incomplete because it doesn't make any mention of how to deploy the resulting set of applications.

I have a netfx aspnet mvc5 monolithic application which is hosted on azure web app. When I follow the process to start upgrading and breaking it apart I end up with 3 applications. the Proxy (net8), Legacy (netfx) and Modern (net8) applications. I need requests to come in to the Proxy project and then be routed to the Legacy and Modern projects but I can't find a way to do this without needing additional web apps which will increase costs and deployment complexity.

Can you provide some guidance on how to move into the deployment stages of a migrated upgrade using yarp without using containers please.

danroth27 commented 2 months ago

Hi @Wraith2. Take a look at the related docs for incremental upgrades here: https://learn.microsoft.com/aspnet/core/migration/inc/overview. With this approach, the YARP proxy is typically hosted in the ASP.NET Core process, not a separate one.

Wraith2 commented 2 months ago

An interesting option. Is it possible to host in another process without additional reasources? I haven't managed to find a way yet. If i mix the proxy and web process together I can't monitor performance of the individual parts in a sensible way, i wouldn't know if the proxy or requests were using resources.

danroth27 commented 2 months ago

Is it possible to host in another process without additional resources? I haven't managed to find a way yet.

The incremental migration approach requires running two separate apps while you're doing the migration. Once the migration is complete, you're left with just the one resource for the migrated app.

If i mix the proxy and web process together I can't monitor performance of the individual parts in a sensible way, i wouldn't know if the proxy or requests were using resources.

The way the incremental migration setup works is that the ASP.NET Core process first handles whatever requests it can, and then anything else gets forwarded by YARP to the original ASP.NET process to handle. So, any requests going to the ASP.NET process are proxied requests.

twsouthwick commented 1 week ago

@Wraith2 did that answer your question? Or are there any others?