chapter two

2 Managing infrastructure components with containers and integrations

 

This chapter covers

  • Understanding the fundamentals of Docker containers
  • Integrating a Keycloak Docker container with Aspire to enable single sign-on (SSO) security
  • Understanding Aspire integrations and their benefits over raw Docker containers
  • Adding a prebuilt Aspire integration for Redis to an application
  • Building a custom Aspire integration library from scratch

In a real-life enterprise-grade application, services need to connect to various infrastructure components, such as databases and message brokers. In this chapter, we discuss two ways infrastructure components can be wired up in an Aspire application:

  1. By using Docker containers
  2. Via the Aspire integration libraries

Most enterprise-grade systems require security, and the e-commerce application we're building is no exception. Security is especially important in these kinds of applications. You absolutely don’t want anyone to steal your credit card data or make purchases on your behalf! This is why we'll build a system that allows our users to register, log in, and gain the necessary permissions to access the appropriate areas of our app.

2.1 Docker containers

2.2 Keycloak overview

2.3 Initial setup

2.4 Adding a Keycloak container to an Aspire host

2.4.1 Configuring the web frontend app

2.4.2 Configuring API service

2.4.3 Other service types Aspire can host

2.5 How Aspire integration libraries differ from containers

2.6 Configuring Aspire integrations on the host

2.6.1 Connecting to an integration from a hosted service

2.6.2 Viewing integrations in the dashboard

2.7 Building an Aspire integration library

2.7.1 Building an integration component

2.7.2 Launching a custom integration from Aspire Host

2.8 Summary