Skip to main content
Guide

Interactive shell

An interactive shell is a terminal session inside a running sandbox. Use it when you need to inspect a disk image, debug a failed run, or try commands before you script them.

Connect from the portal

The portal opens a streaming console to the selected sandbox. Use it for manual debugging sessions.

  1. Open sandboxes.azure.com/sandbox-groups and select your sandbox group.
  2. Select Sandboxes.
  3. Select a running sandbox.
  4. Run commands in the streaming console. Type exit or close the console when you are done.
aca sandbox create --disk ubuntu --label name=demo-shell
aca sandbox shell -l name=demo-shell

Create a sandbox and open a shell

Use this flow for a throwaway debugging sandbox. Delete the sandbox when the shell closes.

  1. Open your sandbox group and select Sandboxes.
  2. Select Create.
  3. Pick the ubuntu disk image and select Create.
  4. Open the new sandbox, and run commands.
  5. Select Delete when the debugging session is complete.
aca sandbox create --disk ubuntu --label name=demo-shell
aca sandbox shell -l name=demo-shell
aca sandbox delete -l name=demo-shell --yes

Choose shell or exec

Use shell for a live terminal. Use exec when automation needs one command and captured output.

SDK shell support

The Python SDK exposes sandbox.exec(...) for one-shot commands. It does not expose a PTY shell API. For an interactive shell from Python, invoke aca sandbox shell.

aca sandbox exec -l name=demo-shell -c "whoami"
aca sandbox shell -l name=demo-shell
You want toUse
Run one command and capture outputaca sandbox exec or sandbox.exec(...)
Try commands by handaca sandbox shell or portal
Run a terminal editoraca sandbox shell or portal
Pipe a script non-interactivelyaca sandbox exec