chapter seven

7 Introduction to .NET Aspire integrations

 

This chapter covers

  • The fundamentals of .NET Aspire integrations
  • The benefits of using .NET Aspire integrations over raw Docker containers
  • Adding .NET Aspire integrations to a .NET Aspire app
  • Setting up a Redis output cache as an .NET Aspire integration
  • Adding a custom .NET Aspire integration

As well as being able to orchestrate .NET projects, executables, and Docker containers, .NET Aspire can also orchestrate the so-called .NET Aspire integrations (also known as .NET Aspire components). These components are special libraries that add popular packages to our distributed application, which include the following:

  • Databases (e.g. SQL Server, PostgreSQL, etc.)
  • Message brokers (e.g. Kafka, Service bus, etc.)
  • Distributed cache (e.g. Redis)

The integrations are mostly based on Docker containers. However, the libraries that enable them have a whole range of extension methods that make it much easier to host such components in .NET Aspire compared to working with Docker containers directly.

7.1 Redis output caching in the starter project

7.2 Configuring .NET Aspire integrations on the host

7.3 Connecting to an integration from a hosted service

7.4 Viewing integrations in the dashboard

7.5 Building a .NET Aspire integration library

7.5.1 Building an integration component

7.5.2 Launching a custom integration from Aspire Host

7.6 Summary