chapter nine

9 Deploying Aspire apps to production

 

This chapter covers

  • Scaling out individual services in Aspire
  • Generating Aspire manifests for distributed application deployment
  • Deploying Aspire applications to Azure Container Apps
  • Using Aspir8 to deploy Aspire apps to a Kubernetes cluster in any cloud environment

So far, we’ve looked at how Aspire apps can be orchestrated while being built and debugged on a development machine. But eventually, we have to deploy the app to production.

Aspire has some built-in mechanisms for doing this, and we’ll look at them in this chapter. The code samples we’ll use are available at https://mng.bz/MwaW.

Before we jump into deploying Aspire apps, let’s delve into some modifications of our Aspire setup that will make it easier to manage the application after deployment.

9.1 Predeployment modifications of Aspire-hosted systems

Why would we modify our system further before deploying it? We might have multiple reasons to do so. We may anticipate that for certain types of services, we’ll always run multiple replicas. Perhaps we’re expected to deal with high user throughput, and a single replica won’t cut it. In Aspire, we can add more replicas to handle the additional load.

9.1.1 Running multiple instances of a service

9.1.2 Running environment-specific services

9.1.3 Managing database migrations

9.1.4 Modifying the dashboard

9.2 Preparing Aspire for deployment

9.3 Deploying to Azure Container Apps

9.3.1 Using the Azure Developer CLI

9.3.2 Deploying from Visual Studio

9.3.3 Obtaining the deployment files

9.4 Converting Aspire manifest to Terraform

9.5 Converting Aspire manifest to Kubernetes

9.5.1 Using Aspir8

9.5.2 Deploying to a Kubernetes cluster

9.6 Building CI/CD pipelines for Aspire

9.6.1 Creating a GitHub Actions pipeline

9.6.2 Creating an Azure DevOps pipeline

9.6.3 Building pipelines for Kubernetes deployment