Skip to main content
.NET Aspire applications can be deployed to various cloud platforms and container orchestration environments. The framework provides a flexible deployment model based on manifest generation that enables deployment to Azure Container Apps, Kubernetes, and other container platforms.

Deployment Model

Aspire uses a pipeline-based deployment model where your application model is transformed into deployment artifacts:
  1. Development: Define your application using the Aspire app model in your AppHost project
  2. Manifest Generation: Generate a deployment manifest describing all resources and their configuration
  3. Deployment: Deploy to your target environment using platform-specific tools

Manifest Generation

The manifest is a JSON file that describes your entire application topology, including:
  • Container images and their configurations
  • .NET projects and their build settings
  • Environment variables and configuration
  • Service endpoints and bindings
  • Dependencies between resources

Generating a Manifest

Use the aspire CLI to generate a deployment manifest:
aspire deploy --output-path ./deployment-artifacts
This creates an aspire-manifest.json file in the output directory:
{
  "$schema": "https://json.schemastore.org/aspire-8.0.json",
  "resources": {
    "apiservice": {
      "type": "project.v0",
      "path": "../ApiService/ApiService.csproj",
      "env": {
        "OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES": "true",
        "OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES": "true"
      },
      "bindings": {
        "http": {
          "scheme": "http",
          "protocol": "tcp",
          "transport": "http"
        },
        "https": {
          "scheme": "https",
          "protocol": "tcp",
          "transport": "http"
        }
      }
    }
  }
}

Manifest Resource Types

The manifest supports several resource types:
Represents a .NET project that will be built and containerized.
{
  "type": "project.v0",
  "path": "../ApiService/ApiService.csproj",
  "env": { },
  "bindings": { }
}
Represents a pre-built container image.
{
  "type": "container.v0",
  "image": "mcr.microsoft.com/dotnet/sdk:9.0",
  "env": { },
  "bindings": { }
}
Represents a container built from a Dockerfile.
{
  "type": "container.v1",
  "build": {
    "context": "../frontend",
    "dockerfile": "../frontend/Dockerfile"
  },
  "env": { },
  "bindings": { }
}
Represents a connection string or other configuration value.
{
  "type": "value.v0",
  "connectionString": "{postgres.connectionString}"
}
Represents a deployable parameter with optional secrets.
{
  "type": "parameter.v0",
  "value": "{password.inputs.value}",
  "inputs": {
    "value": {
      "type": "string",
      "secret": true
    }
  }
}

Deployment Targets

.NET Aspire supports deployment to multiple platforms:

Azure Container Apps

Deploy to Azure’s serverless container platform with automatic scaling and managed infrastructure

Kubernetes

Deploy to any Kubernetes cluster using Helm charts or kubectl

Deployment Pipeline

The deployment process uses a pipeline architecture located in src/Aspire.Hosting/Publishing/:

Pipeline Steps

  1. Manifest Publishing - Generates the deployment manifest
  2. Deployment Step - Executes platform-specific deployment logic
You can customize the deployment process by implementing custom pipeline steps.

Using the Deploy Command

The aspire deploy command orchestrates the deployment:
# Deploy to default environment
aspire deploy --output-path ./artifacts

# Deploy with specific environment
aspire deploy --environment Production --output-path ./artifacts

# Clear deployment cache
aspire deploy --clear-cache --output-path ./artifacts
The deploy command is located in src/Aspire.Cli/Commands/DeployCommand.cs and executes the publish pipeline with the --step deploy flag.

Deployment State Management

Aspire tracks deployment state to enable incremental deployments and rollbacks:
  • State is stored per environment (Development, Staging, Production)
  • Use --clear-cache to reset deployment state
  • State managers are implemented in src/Aspire.Hosting/Pipelines/Internal/

Next Steps

Deploy to Azure

Learn how to deploy to Azure Container Apps and configure Azure resources

Deploy to Kubernetes

Learn how to deploy to Kubernetes clusters using Helm

Additional Resources

Build docs developers (and LLMs) love