Modern Serverless applications on Azure
Bigger picture, Frameworks, .NET changes and platform maturity
TL;DR; The serverless ecosystem on Azure matured well over the years, and with .NET 8 and new SDKs like .NET Aspire, Dapr, and Microsoft Radius, it has become the default choice for building greenfield projects. In this article, I will connect bits and pieces, providing a coherent view of components for building modern apps on Azure.
Plan
It seems like Microsoft’s plan is to provide a one-stop experience with Visual Studio the way it worked with Microsoft Service Fabric(if you know, you know:) ). But a few misconceptions exist in the developer community, so let’s straighten things out a bit.
- Developer tools and frameworks
- DevOps tools and frameworks
- Summary
Developer
Let’s start with the code. .NET has come a long way from big bundles and moderate performance and provides many much-needed optimizations.
The introduction of an ahead-of-time compilation to minimize the application bundle has already impacted minimal APIs and will further boost Azure Functions’ cold start performance. There is an older version of this, called ready-to-run, available for your Azure functions, but since we are moving to the out-of-process model , everything will be unified.
Native resilience
We all know the Polly framework and have used it for many years with .NET applications, but this is another package that impacts bundle size and start performance. Now, we have native resilience components available for .NET apps.
Better alternative to docker compose
I can recall a time when Visual Studio tooling provided everything you needed, and we got that awesome experience back with the .NET Aspire framework.
Integration testing
Yes, there is a Testcontainers framework, and it is working very well. As we discussed before, Microsoft is doing a great job of minimizing external dependencies, and now it is possible to use .NET Aspire for integration testing as well.
Chiseled containers
The main component of the Azure Container Apps performance stack and the upcoming Azure Functions complete switch to an out-of-process model is lightweight containers. So your apps will start faster, and you get to decide how many dependencies you need, down to the 8 dependencies for AoT-optimized applications.
Azure Container apps (ACA)
Great abstraction over Azure Kubernetes Service with the ability to go with lightweight HTTP services or build advanced scenarios using Distributed Application runtime DAPR limited version. Some people want limited access to Kubernetes APIs here, but there is AKS to help with that.
As you can see in the grid below, you get access to the native resilience components of DAPR, scheduled jobs, and advanced networks if needed
Azure Container Apps provide a perfect way to start with your application and then easily migrate to Azure Kubernetes Service if needed.
DevOps
This part is related to understanding the difference between .NET Aspire and Microsoft Radius and how they fit together. It all boils down to the level of abstraction. Aspire solves the problem of applications working locally and on Kubernetes, while Radius prepares recipes to deploy your application everywhere — preferably to Azure, of course :), but also to any Kubernetes cluster.
Let’s look at Radius; I will skip terminology and documentation rehearsal and provide a documentation link in the link section.
Radius is still in a preview but already offers a command line and some UI functionality to understand application topology, configuration, and network port 3000 for app configuration and 7007 for portal if you will connect to your Kubernetes cluster with port forwarding.
And Radius portal.
As you can see, the infrastructure description is currently done via Bicep language, but Terraform is coming, so there might be more alternatives in the future.
Summary
So, let’s have a look at the bigger picture again.
So, Microsoft aims to provide you with the full lifecycle ecosystem to develop microservices, start with lightweight serverless microservices, and then grow easily with the help of DAPR, AKS, and Radius recipes to host your application anywhere.
Thanks for reading. Ping me on LinkedIn if you have any questions, and say hi at the conference; don’t be a stranger.
Links
- Code to cloud talk by David Fowler & Damian Edwards https://youtu.be/R8S_cfao1L8?si=rCe7o-X-mrSsnq60
- https://github.com/radius-project/radius
- https://learn.microsoft.com/en-us/dotnet/aspire/
- https://docs.radapp.io/