Deployment boundaries
Deployment boundaries
Deployment translates a development topology into explicit runtime infrastructure, identities, configuration, resource budgets and operational responsibilities. Aspire can model and produce target-specific deployment workflows, but local success is not production readiness.
In the current Aspire documentation, aspire publish emits deployment artifacts for a target-specific handoff; aspire deploy can apply changes directly, depending on configured integrations. Neither should be run without reviewed target selection, credentials, cost limits and explicit authorization. A production scheduler or hosting platform owns running instances, routing, scaling, health, rolling replacement and recovery. A publish artifact does not prove a successful rollout. Inventory should use environment-specific storage, least-privilege service identities, authenticated TLS, externally managed secrets and tested backups. Local connection strings can contain credentials; avoid printing configuration dumps and dashboard tokens. Prefer references to a secret store, not real values in source or logs. Review generated manifests, immutable image digests, network policies, CPU/memory, migration ordering, readiness checks, monitoring and rollback. Rollback may not reverse schema changes; use an expand/contract plan and test compatibility across versions. Define owners, an abort criterion and a cleanup plan. The examples below are offline validation models; no cloud account, deployment target, container engine or billable action is required.
Baseline: .NET 10 / C# 14. All C# results below are reasoned, not executed. Offline models and the separate Aspire lab are explicitly distinguished.
Fail closed when required deployment settings are missing
Use only synthetic configuration identifiers, not actual credentials. Validate presence without printing values.
Use the archived Fixture.csproj with an approved .NET 10 SDK. No third-party packages are required. Inspect the project, then build and run with the approved SDK.
using System;using System.Collections.Generic;var settings = new Dictionary<string, string> { ["InventoryEndpoint"] = "inventory.internal" };foreach (string key in new[] { "InventoryEndpoint", "DatabaseIdentity" }) { bool present = settings.TryGetValue(key, out var value) && !string.IsNullOrWhiteSpace(value); Console.WriteLine($"{key}: {(present ? "configured" : "missing")}");}Expected result (not executed):
InventoryEndpoint: configuredDatabaseIdentity: missingPresence does not prove a valid identity or network route. Production startup validation should also check allowable configuration and avoid exposing values.
Budget replicas without claiming measured cost
A fictional service reserves 256 MiB per replica; a target allows 1024 MiB for that service. Check the planned rollout surge.
Use the archived Fixture.csproj with an approved .NET 10 SDK. No third-party packages are required. Inspect the project, then build and run with the approved SDK.
using System;const int limit = 1024, perReplica = 256;foreach (int replicas in new[] { 3, 4, 5 }) { int reserved = replicas * perReplica; Console.WriteLine($"{replicas}: {reserved} MiB; fits={reserved <= limit}");}Expected result (not executed):
3: 768 MiB; fits=True4: 1024 MiB; fits=True5: 1280 MiB; fits=FalseThese are hypothetical reservations, not observed memory or price. Include rollout surge, shared platform overhead and real resource measurements before selecting limits.
Gate a simulated rollout on evidence
A toy release check requires readiness, backward schema compatibility and verified rollback. A missing gate blocks promotion.
Use the archived Fixture.csproj with an approved .NET 10 SDK. No third-party packages are required. Inspect the project, then build and run with the approved SDK.
using System;foreach (var candidate in new[] { (true, true, false), (true, true, true), (false, true, true) }) { bool promote = candidate.Item1 && candidate.Item2 && candidate.Item3; Console.WriteLine(promote ? "eligible for review" : "blocked");}Expected result (not executed):
blockedeligible for reviewblockedPassing these boolean checks does not deploy anything. Real release decisions require measured evidence, independent authorization, migration verification and an audited rollback plan.
Apply the concept
Write a deployment handoff for the inventory topology. Include configuration ownership, secret references, service identities, network policy, health probes, rollout limits, backup and rollback, and an approval boundary.
Use the manual practice and knowledge check. Do not deploy or publish these fixtures.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Deployment boundaries — knowledge check
Apply the lesson concepts to the following scenarios.
What is the difference between aspire publish and aspire deploy?
Who typically owns runtime scaling in production?
What should deployment logs avoid?
Why account for rollout surge in resource planning?
Why is rolling back a binary not always enough?