The First .NET Aspire Book!

My new book is available! It’s the first book about .NET Aspire, covering all the aspects of creating microservices with .NET!

.NET Aspire offers new tools and libraries to make it easy creating, debugging, and deploying services-based applications with .NET. I’m loving it and worked hard to create a book!

Pragmatic Microservices

Creating a game application

Reading and working through the book, you not only learn a lot, but it’s also fun! From the second chapter on you create an application to run a game, making use of several NuGet packages that are available via NuGet, so you don’t need to think about the algorithms and can concentrate on the aspects important creating microservices!

Services running using Microsoft Azure

Running on Microsoft Azure, the application makes use of Azure Container Apps, and several services. In the next image you see the interaction with a bot service which plays several games. Of course, other clients using Blazor, WinUI, WPF, Uno Platform, and Avalonia UI are available as well. However, the bot service is faster in playing complete games which helps with testing and monitoring. The bot service is triggered from a message in the queue and sends requests to the game APIs service using gRPC.

Codebreaker - Async communication with queues

The next image shows the asynchronous communication from the game APIs service. On game completion, an event is fired – using Azure Event Hub. Subscribers to these events are the live service which allows live monitoring of games, and the ranking service. The ranking service has its own database to store game information used to calculate ranks.

Codebreaker – Async communication with events

Other Azure services used are Azure App Configuration, Azure Key Vault, Azure Load Testing, Azure Cosmos DB, and many more!

Services running in an on-premises environment

In the book you’ll see services that can run on premises as well. Instead of using Azure, the application can run completely independent of Azure. For example, instead of using Azure Event Hub, the alternative option that’s used is Apache Kafka. The application is deployed to a Kubernetes cluster using Aspir8.

The book tour

With the book I take you at a tour across all the important aspects when creating microservices, and .NET Aspire is used all the way!

Part 1: Creating Microservices with .NET

  • Chapter 1, Introduction to .NET Aspire and Microservices gives an introduction of .NET Aspire, and what’s about the application we develop.
  • Chapter 2, Minimal APIs – Creating REST services kicks off creating the game APIs service. It’s already running, and you can play games (just using HTTP files).
  • Chapter 3, Writing data to relational and NoSQL databases adds persistence. The games are no longer just stored in-memory, but make use of SQL Server and Azure Cosmos DB. More time to play a game!
  • Chapter 4, Creating Libraries for Client Applications adds client libraries and console applications. One client library just uses the HTTP client factory, while the second one makes use of Microsoft Kiota – this tool allows to create the client from the Open API definition.

Part 2: Hosting and Deploying

  • Chapter 5, Containerization of Microservices – here you learn all you need to know about Docker, and take advantages of the built-in functionality of dotnet publish which allows creating Docker images without the need to create Dockerfiles.
  • Chapter 6, Microsoft Azure for Hosting Applications makes use of Azure services. You learn about the core services used by the application, and finally publish the application to Azure with the Azure Developer CLI.
  • Chapter 8, CI/CD with GitHub Actions adds CI/CD to the deployment story. GitHub actions will be used to automatically deploy the application as well as NuGet packages for the client applications.
  • Chapter 9, Authentication and Authorization adds B2C to allow users to register – and ASP.NET Core Identities to offer this functionality in an on-premises environment.

Part 3: Troubleshooting and Scaling

  • Chapter 10, All about testing the solution adds unit tests and integration tests. .NET Aspire offers test template for easier testing of services. You’ll also learn using Microsoft Playwright to create API tests.
  • Chapter 11, Logging and monitoring – oh, this is an important chapter to know what’s going on with the services. Not only will you use .NET structured logging, distributed tracing, and metrics with Open Telemetry and the .NET Aspire Dashboard, Azure App Insights and Log Analytics – also Grafana and Prometheus will be used with the on-premises version.
  • Chapter 12, Scaling Services – here you use Azure Load Testing to create a huge load (you can avoid creating the huge load and just read about the results), and both scale the services using more CPU and memory, as well as more instances – vertical and horizontal scaling. We’ll also increase performance by using a cache and compare the differences.

Part 4: More communication options

  • Chapter 13, Real-time messaging with SignalR makes use of another communication technique with ASP.NET Core SignalR, the live service sends information about completed games to all connected clients.
  • Chapter 14, gRPC for binary communication changes from REST services to use gRPC for communication between services. Reducing CPU, memory, and data transfer usage can reduce the amount of money needed.
  • Chapter 15, Asynchronous communication with messages and events adds Apache Kafka and Azure Event Hub and the ranking service: which user has the best game run of the week?
  • Chapter 16, Running the application on-premises and in the cloud makes use of Aspir8 to deploy the application to Kubernetes, combines functionality from previous chapters, and investigates what’s next.

As you see this gives you important information – not only when creating a microservices application architecture – but you’ll also read information that helps with simpler distributed solutions. All the way, tooling, orchestration, and components using .NET Aspire comes into play.

As you see this gives you great information – not only when creating a microservices application architecture – but you’ll also read information that helps with simpler distributed solutions. All the way, tooling, orchestration and components using .NET Aspire comes into play.

All the way, you can play a game to solve the code of four or five matching colours, or matching colours and shapes.

Codebreaker Game play

Now, get the book!

You’ll enjoy reading and playing (e-book or print):

Packt Publishing – Pragmatic Microservices

Amazon US – Pragmatic Microservices

Amazon DE – Pragmatic Microservices

or from your preferred book distributor.

Since some years I’m using a Packt subscription myself to read all the books available there! Of course, this includes the Pragmatic Microservices book!

I had a tour working with .NET Aspire previews, continuously updating the code with the improvements coming from .NET Aspire. It was a challenge, but also fun to influence .NET Aspire. I’m sure you like my new book! Looking forward to your feedback!

Enjoy! Christian

More Information

More information about .NET Aspire is available in my book and my workshops.

Source code of Pragmatic Microservices

More Codebreaker Repos

.NET Workshops

One thought on “The First .NET Aspire Book!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.