Quick start
CLI
Install the aca CLI, provision a sandbox group, launch a sandbox, run a command, and tear it all down.
Before you begin
- An Azure subscription with permission to create resource groups.
- Azure CLI (
az) installed.acadelegates auth toaz login. - A shell: Bash on Linux/macOS, PowerShell on Windows. (WSL and Git Bash also work.)
Install the aca CLI
- Bash
- PowerShell
curl -fsSL https://aka.ms/aca-cli-install | sh
irm https://aka.ms/aca-cli-install-ps | iex
Smoke-test the install:
- Bash
- PowerShell
aca --version
# aca 1.0.0-preview.4
aca --version
# aca 1.0.0-preview.4
Log in to Azure
Run az login once per shell. Subsequent commands reuse the same Azure CLI session.
- Bash
- PowerShell
az login
az login
Provision the resource group and sandbox group
- Bash
- PowerShell
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
$SubscriptionId = 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 $SubscriptionId `
--set-config
note
--set-config saves the subscription, resource group, sandbox group, and region in aca config so you don't have to pass them on every subsequent command. Group creation also attempts to grant your signed-in user the Data Owner role; if that fails, aca doctor reports the missing access.
Verify with aca doctor
- Bash
- PowerShell
aca doctor
aca doctor
Create and run a sandbox
Tag the sandbox with a label at create time, then use -l (label selector) to target it from exec and delete — no need to capture the ID.
- Bash
- PowerShell
aca sandbox create \
--disk ubuntu \
--label name=my-first-sandbox
aca sandbox exec -l name=my-first-sandbox -c "echo 'Hello from ACA Sandbox.'"
aca sandbox delete -l name=my-first-sandbox --yes
aca sandbox create `
--disk ubuntu `
--label name=my-first-sandbox
aca sandbox exec -l name=my-first-sandbox -c "echo 'Hello from ACA Sandbox.'"
aca sandbox delete -l name=my-first-sandbox --yes
Teardown (optional)
Delete the sandbox group and the resource group:
- Bash
- PowerShell
aca sandboxgroup delete -g my-rg --name my-sandbox-group --yes
az group delete --name my-rg --yes --no-wait
aca sandboxgroup delete -g my-rg --name my-sandbox-group --yes
az group delete --name my-rg --yes --no-wait