You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documents the new --volumes option added to aspire stop --force in
microsoft/aspire#20195. By default --force still preserves persistent
volumes; --volumes opts in to also removing Aspire-owned named volumes.
Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/frontend/src/content/docs/reference/cli/commands/aspire-stop.mdx
+29-3Lines changed: 29 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Use `--force` to stop the selected AppHost and then remove the persistent resour
41
41
aspire stop --force
42
42
```
43
43
44
-
The command performs the normal stop flow first, then removes persistent resources associated with the AppHost. The command attempts to clean up persistent resources whether or not an instance of the AppHost is running. Persistent resources started using a version of the Aspire CLI released before `--force` support was added can't be cleaned up using `--force`.
44
+
The command performs the normal stop flow first, then removes persistent resources associated with the AppHost. The command attempts to clean up persistent resources whether or not an instance of the AppHost is running. Persistent resources started using a version of the Aspire CLI released before `--force` support was added can't be cleaned up using `--force`. By default, `--force` preserves persistent volumes so that data survives cleanup.
45
45
46
46
:::caution
47
47
The `--force` option permanently removes the selected AppHost's persistent resource instances without an additional confirmation prompt. Data stored only in those resources can be lost. For container resources, use a [volume or bind mount](/fundamentals/persist-data-volumes/) to persist data independently of a specific resource's lifetime.
@@ -54,6 +54,22 @@ Additional notes and limitations:
54
54
- For a .NET AppHost that doesn't use the Aspire CLI bundle, cleanup requires Aspire.Hosting 13.5 or later. If the AppHost uses an older version, its version can't be determined, or its project can't be inspected, the command displays a warning and still attempts cleanup. Resources created without the required workload metadata might remain.
55
55
- If the AppHost stops successfully, but persistent resource cleanup fails, the command exits with an error but leaves the AppHost stopped. You can resolve any errors and run `aspire stop --force` again or manually clean up any remaining persistent resources if necessary.
56
56
57
+
### Also remove persistent volumes
58
+
59
+
By default, `aspire stop --force` preserves any [persistent volumes](/fundamentals/persist-data-volumes/) created for the AppHost, so their data survives cleanup. Pass `--volumes` together with `--force` to also remove those volumes:
60
+
61
+
```bash title="Aspire CLI"
62
+
aspire stop --force --volumes
63
+
```
64
+
65
+
`--volumes` requires `--force`; using `--volumes` without `--force` fails with an error. Only named volumes that Aspire created and tracks ownership of are removed. Anonymous volumes and bind mounts are unaffected, and a volume that existed before the AppHost started is adopted for mounting but isn't recorded as Aspire-owned, so cleanup leaves it intact.
66
+
67
+
:::caution
68
+
Removing persistent volumes permanently deletes their data. There's no additional confirmation prompt before deletion.
69
+
:::
70
+
71
+
For a non-bundle .NET AppHost older than Aspire.Hosting 13.6, the CLI can't determine whether the AppHost created the volume-ownership records required for cleanup and displays a compatibility warning before still attempting cleanup.
72
+
57
73
Before scanning for AppHosts to stop, `aspire stop` also detects and cleans up any orphaned AppHosts whose launching CLI process has died, so leaked processes are removed even if a normal stop can't reach one of them.
58
74
59
75
## Options
@@ -70,7 +86,11 @@ The following options are available:
70
86
71
87
-**`--force`**
72
88
73
-
Perform the normal attempt to stop all instances of a specific AppHost, then attempt to clean up persistent resources associated with that AppHost. You can combine this option with `--apphost` to specify an AppHost to stop, but not with `--all`.
89
+
Perform the normal attempt to stop all instances of a specific AppHost, then attempt to clean up persistent resources associated with that AppHost, preserving persistent volumes by default. You can combine this option with `--apphost` to specify an AppHost to stop, but not with `--all`.
90
+
91
+
-**`--volumes`**
92
+
93
+
Also remove persistent volumes created by Aspire during persistent resource cleanup. Requires `--force`.
Copy file name to clipboardExpand all lines: src/frontend/src/content/docs/whats-new/aspire-13-6.mdx
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -251,11 +251,19 @@ aspire sdk export
251
251
-**Stricter `wait` failures.**`aspire wait` exits with code `18` as soon as a resource reaches `FailedToStart`, including when the requested target status is `down`.
252
252
-**Safer resource descriptions.**`aspire describe` redacts a resource's own secret environment-variable values as well as secrets passed to dependents. Secrets embedded inside larger connection strings aren't automatically detected.
253
253
-**Clearer terminal output.**`aspire ps` colorizes statuses, and progress rendering is suppressed when console logging is enabled.
254
+
-**Opt-in volume cleanup.**`aspire stop --force` continues to preserve persistent volumes by default. Add `--volumes` to also remove volumes that Aspire created and owns:
255
+
256
+
```bash title="Aspire CLI — Remove persistent volumes on stop"
257
+
aspire stop --force --volumes
258
+
```
259
+
260
+
`--volumes` requires `--force`. Only Aspire-owned named volumes are removed; anonymous volumes, bind mounts, and volumes that existed before the AppHost started are left intact.
254
261
255
262
<LearnMore>
256
263
See the [`aspire run`](/reference/cli/commands/aspire-run/), [`aspire
257
-
describe`](/reference/cli/commands/aspire-describe/), and [`aspire
0 commit comments