Edit

Quickstart: Create your first Azure Container Apps sandbox using the aca CLI (preview)

In this quickstart, you install the aca CLI, provision a sandbox group, launch a sandbox, run a command, and tear it all down.

Important

Azure Container Apps Sandboxes are currently in preview. Sandboxes created during preview might not be compatible with future releases and might need to be recreated.

Prerequisites

  • An Azure subscription with permission to create resource groups.
  • Azure CLI (az) installed. aca delegates auth to az login.
  • A shell: Bash on Linux/macOS, PowerShell on Windows. WSL and Git Bash also work.

Install the aca CLI

Note

These commands download and run an installation script. If your environment requires it, review the script contents at the URL before running it.

curl -fsSL https://aka.ms/aca-cli-install | sh

Verify the installation:

aca --version
# aca 1.0.0-preview.1

Sign in to Azure

Run az login once per shell. Subsequent commands reuse the same Azure CLI session.

az login

Provision the resource group and sandbox group

SUBSCRIPTION_ID=$(az account show --query id -o tsv)

az group create \
  --name my-rg \
  --location westus2

aca sandboxgroup create \
  -g my-rg \
  --name my-sandbox-group \
  --location westus2 \
  -s "$SUBSCRIPTION_ID" \
  --set-config

Note

The --set-config parameter writes the group, subscription, and region into aca config so you don't have to pass them on every subsequent command.

Verify with aca doctor

aca doctor

Create and run a sandbox

Tag the sandbox with a label when you create it, and then use -l (label selector) to target it from exec and delete commands. You don't need to capture the ID.

aca sandbox create \
  --disk ubuntu \
  --label name=my-first-sandbox

aca sandbox exec -l name=my-first-sandbox -c "echo 'Hello from an Azure Container Apps sandbox.'"

aca sandbox delete -l name=my-first-sandbox --yes

Clean up resources

Delete the sandbox group and the resource group:

aca sandboxgroup delete -g my-rg --name my-sandbox-group --yes
az group delete --name my-rg --yes --no-wait

Next steps