Windows vs Linux App Services for dotnet apps

Copper Contributor

Hi :)

I expect that this question is highly subjective. 

 

I've hosted dotnet framework stuff on Windows VMs for years. When dotnet core came out I started hosting new apps on Linux VMs because they were lighter / cheaper. I'm deploying my first project as an Azure app service. It's dotnet core / blazor. The person who set it up before me set up Windows app services. I'm inclined to switch it to Linux moving forward but am questioning my motifvations. Are there any practical reasons? Does the argument about lowere resource usage (and hopefully better performance) hold true in the app service domain as it (I assume) it does in the VM world?

Thanks very much

3 Replies

@damiensawyer 

 

Yes this depends on how you are using Blazor.

If you are using Blazor WASM, then you are basically running a static web app (all code execute on the Client in the browser). If you are using Blazor Server it is more like a classic ASP.NET application and you will require some server-side compute capability (like App Services).

 

I will assume you are using Blazor Server else Azure Storage Accounts or Static Web Apps are much cheaper as you don't require server-side compute with WASM.

 

At the onset it might look like costs are the driving factor, but even though there is proof that some apps out-perform windows when running on Linux it will largely depend on the type of application and how it is used.  There are also some areas in Dotnet that seem to perform better in Windows.

 

Pricing is also dependent on the SKU as for certain SKU's the price difference is marginal, while with others the price difference is substantial. Consider the options below:

 

Standard Plan Windows (4CPU, 7GB): $292/Month
Standard Plan Linux (4CPU, 7GB): $277/Month
Premium V3 Windows (4CPU, 16GB): $489/Month
Premium V3 Linux (4CPU, 16GB): $255/Month

 

The features are mostly the same except Windows plans allow you to set the Default document and create Virtual application and Handler mappings but other than that the features are mostly the same.
So it does come down to the performance in most cases but I would not bet on Linux out-performing Windows as all applications are different.

 

My suggestion is that you run tests on both and see what the performance is like for your specific application. You might for example setup an App Insights service and document things like page load times, etc. and see what exactly the difference are. This is important and will affect your cost as the most performant platform will generally create less instances which will even be less costly.

Here is a custom MSLearn module to setting this up for you r application that might come in handy.

 

Hope this helps, 

 

 - Johan

 

#skillingexpert

@sayedimac 
Thanks Johan for the detailed response, that's very useful. The pricing divergance with increased size is particularly interesting. I digress, but it reminds me of a story someone told me years ago about choosing between Postgres and SQL Server on a big project. At small scale, the costs were similar, but as they scaled up and needed to move to higher feature sets of the dbs, the SQL Server costs blew out considerably. 

 

The project (which I inherrited) is Blazor WASM with a .Net backend. I haven't looked into the deployment stuff yet, but I guess I could separate them and host the static files more efficiently somewhere. 

 

Thanks very much for your help :)

 

 

 

DS

Absolute pleasure!
Look no further than Azure Static Web Apps for that. Caters for the static WASM content, custom Domains as well as hosted Azure Functions as part of the Static web app or separately that give you a back-end architecture for data access.

Let me know if you need to connect and discuss this further please - would be happy to walk you through an example.

We have some walkthroughs for this on MSLearn as well:
https://learn.microsoft.com/en-us/azure/static-web-apps/getting-started?tabs=blazor