liveBook · Manning

Chapter 1: Getting started with distributed systems and Aspire

What you will learn in chapter 1 of Building Distributed Applications that Work

The introduction explains why a multi-component application is difficult to run locally and how Aspire’s AppHost gives developers one place to model and work with it.

After this chapter you will be able to

Section by section

Introduction

The introduction explains why a multi-component application is difficult to run locally and how Aspire’s AppHost gives developers one place to model and work with it.

Key terms: distributed application, storefront, catalog API, configuration, dependencies, logs, Aspire, AppHost, code-first application model, resources

1.1 The online shop as a distributed workflow

The section traces a shopper’s journey through the online shop’s independently running components, starting with catalog browsing and showing why later cross-component workflows need observability.

Key terms: storefront, catalog API, HTTP request, message broker, background service, checkout requests, logs, metrics, distributed traces, observability

1.2 Why the application is difficult to develop locally

The section explains how the online shop’s independently running components form one distributed application, how that differs from a monolith, and why the flexibility adds development complexity.

Key terms: distributed application, components, storefront, catalog API, REST API, monolith, modular monolith, in-process method calls, network requests, deployment unit

1.2.1 Starting several resources

Explains why starting a distributed application locally is harder than launching one application: developers must start multiple resources and account for dependencies and readiness.

Key terms: distributed application, resources, containers, configuration, dependencies, ready to accept requests, temporary failure

1.2.2 Managing addresses and configuration

This section explains why separately running application and infrastructure components need accurate, environment-specific addresses and configuration.

Key terms: hostname, port, DNS name, localhost address, connection string, cache endpoint, message-broker credentials, configuration files

1.2.3 Dealing with network boundaries

This section explains why communication between distributed components can fail even during local development, leaving an application only partly operational.

Key terms: network boundary, network request, dependency, HTTP, WebSocket, partially operational, healthy, catalog API, message broker

1.2.4 Finding failures across multiple components

This section explains why a failure in a distributed application is hard to locate and how distributed tracing helps reveal a request’s path.

Key terms: storefront, catalog API, cache, database, logs, metrics, distributed tracing, traces

1.2.5 Testing the complete workflow

This section explains why independently passing service tests cannot establish that a distributed workflow works, and why testing the complete workflow is difficult to coordinate.

Key terms: isolated tests, complete workflow, integration test, real components, ready, test environment

1.2.6 The need for development-time orchestration

This section explains why coordinating independently running resources calls for development-time orchestration and how Aspire provides it without combining the services into one process.

Key terms: development-time orchestration, resources, application topology, Aspire, AppHost project, central model, shared dashboard

1.3 Overview of orchestration

This section explains how orchestration coordinates a distributed application’s independent resources, from startup and configuration to readiness and system-wide visibility, while distinguishing Aspire’s development-time role from production orchestration.

Key terms: orchestration, services, components, boundaries, orchestrator, dependencies, readiness, health information, configuration, addresses

1.4 How Aspire changes the game

The section explains how Aspire simplifies .NET applications with external components through integrated development, declarative orchestration, observability, and cloud-ready configuration.

Key terms: cloud-native application stack, external component, monolithic applications, microservice orchestration, application model, declaratively, dependencies, shared debugger process, observability, OpenTelemetry

1.5 Getting started with the Aspire Starter Project

Introduces the projects in the OnlineShop solution created from the Aspire Starter Project template and identifies their roles.

Key terms: OnlineShop.Web, OnlineShop.ApiService, OnlineShop.AppHost, OnlineShop.ServiceDefaults

1.6 Orchestrating with Aspire

This section shows how to launch an Aspire-hosted application, inspect its services in the dashboard, and open the UI to verify that it retrieves data from the API.

Key terms: host application, OnlineShop.AppHost, Aspire dashboard, State, Console tab, service logs, Resources tab, endpoint URL, OnlineShop.Web, Weather tab

1.7 Setting up Aspire’s orchestrator

Introduces the upcoming setup of Aspire’s orchestrator by previewing its dependencies and application registration.

1.7.1 Installing Aspire dependencies

This subsection identifies the dependencies and project references an Aspire host needs before it can orchestrate the online shop applications.

Key terms: NuGet packages, Aspire Starter Project template, host application, orchestrator, OnlineShop.AppHost, OnlineShop.Web, OnlineShop.ApiService

1.7.2 Host application startup and service registration

This section explains how the Aspire AppHost creates its host builder, registers the API project, and adds a health check.

Key terms: OnlineShop.AppHost, AppHost.cs, DistributedApplication, host builder, AddProject(), Projects.OnlineShop_ApiService, OnlineShop.ApiService, apiservice, WithHttpHealthCheck("/health"), health-check endpoint

1.7.3 Registering the UI application

Shows how the Aspire host registers the online shop’s UI, exposes it externally, connects it to the API, and waits for the API to be ready.

Key terms: AddProject(), OnlineShop.Web, webfrontend, WithExternalHttpEndpoints(), internal network, public network, WithReference(), API service reference, service discovery, WaitFor()

1.8 Introducing service defaults

Introduces Aspire service defaults as a customizable class library of extension methods for shared application setup, and explains the references it needs.

Key terms: service defaults, extension methods, Aspire orchestrator, service discovery, health, metrics, class library, metrics library, OnlineShop.ServiceDefaults, Microsoft.AspNetCore.App

1.8.1 Adding extension methods

This section identifies the service-default extension methods, summarizes what they add, and explains where applications invoke them.

Key terms: ConfigureOpenTelemetry(), AddOpenTelemetryExporters(), AddServiceDefaults(), service discovery, Extensions.cs, OnlineShop.ServiceDefaults, IHostApplicationBuilder, WebApplication, MapDefaultEndpoints(), health-check endpoints

1.8.2 Using the extension methods

Shows that both online shop applications invoke the shared service-default extension methods in their startup code.

Key terms: Program.cs, service defaults, extension methods, Aspire orchestrator, OnlineShop.Web, OnlineShop.ApiService

1.9 Service discovery in Aspire

This section explains how service discovery lets distributed services find one another and outlines registration, querying, dynamic updates, and its relationship to load balancing.

Key terms: service discovery, microservices, service registration, service registry, service querying, dynamic updates, load balancing

1.9.1 Registering service-discovery components

This subsection identifies the package installation required before enabling Aspire service discovery.

Key terms: service discovery, Microsoft .Extensions.ServiceDiscovery, OnlineShop.ServiceDefaults, NuGet package

1.9.2 Enabling service discovery

The section explains how Aspire service discovery lets hosted applications communicate by name and identifies the calls that enable it in the online shop.

Key terms: service discovery, unique name, IP addresses, AddServiceDefaults(), builder.Services.AddServiceDiscovery(), http.AddServiceDiscovery(), HTTP clients, URIs

1.9.3 Using service discovery

Shows how the web frontend uses a service name instead of a fixed API address, letting Aspire resolve where to connect.

Key terms: AddServiceDefaults(), HTTP client, base address, apiservice, https+http, HTTPS, HTTP, Aspire host application

1.10 Summary

Where this is used later

Concepts explained in this chapter

Chapter 2: Managing infrastructure components with containers and integrations →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.