Sandbox and Sandbox Group Metrics
Sandbox resource metrics are the CPU and memory allocations assigned to running sandboxes in Azure Container Apps. Query Azure Monitor with az for a group you manage in the sandboxes portal.
Prerequisites
- An existing sandbox group and a running sandbox. Keep the sandbox running while you wait for metrics; auto-suspend can occur before samples arrive.
- Azure CLI (
az) installed and signed in to the subscription that contains the group. See CLI setup. - Permission to read the group and Azure Monitor metric definitions and metrics (
Microsoft.Insights/metricDefinitions/readandMicrosoft.Insights/metrics/read). Reader or Monitoring Reader at the group scope or a parent scope is sufficient. - To change the opt-in setting (enabling per-sandbox metrics), permission to write the sandbox group, such as Contributor at the group scope.
What the metrics measure
All four metrics belong to the group's Microsoft.App/sandboxGroups ARM resource and use the metric namespace Microsoft.App/sandboxGroups.
By default, only group-level metrics are enabled. To collect per-sandbox metrics, enable detailed metrics by setting the group's ARM property properties.enableDetailedMetrics to true.
| Metric | Allocation measured | Value unit | Requires detailed metrics enabled |
|---|---|---|---|
SandboxGroup.RunningCores | Sum of assigned CPU cores across running sandboxes in the group. | Cores | No |
SandboxGroup.RunningMemoryGiB | Sum of assigned memory across running sandboxes in the group. | GiB | No |
Sandbox.AssignedCores | Assigned CPU cores for a running sandbox, identified by SandboxId. | Cores | Yes |
Sandbox.AssignedMemoryGiB | Assigned memory for a running sandbox, identified by SandboxId. | GiB | Yes |
Values can be fractional. The memory metrics contain GiB values even when Azure Monitor metric metadata reports the unit as Count.
These are allocation measurements, not CPU utilization percentages, actual memory usage, or billed CPU-seconds.
View metrics in the portal
- Open the ACA Sandboxes portal.
- Open your sandbox group.
The sandbox group overview displays the current number of running cores and running memory (GiB).

Query group allocation
Replace my-rg and my-sandbox-group with your existing resource group and sandbox group names; the subscription ID comes from your current Azure CLI account.
The first request reads the effective opt-in setting. The next lists metric definitions, and the last queries group allocation over the past hour.
- Bash
- PowerShell
SUBSCRIPTION_ID=$(az account show --query id -o tsv)
RESOURCE_GROUP="my-rg"
SANDBOX_GROUP="my-sandbox-group"
RESOURCE_ID="/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.App/sandboxGroups/$SANDBOX_GROUP"
az rest --method get \
--url "https://management.azure.com${RESOURCE_ID}?api-version=2026-07-01" \
--query properties.enableDetailedMetrics --output json
az monitor metrics list-definitions \
--resource "$RESOURCE_ID" \
--output json
az monitor metrics list \
--resource "$RESOURCE_ID" \
--namespace Microsoft.App/sandboxGroups \
--metrics SandboxGroup.RunningCores SandboxGroup.RunningMemoryGiB \
--aggregation Average Maximum \
--interval 1m --offset 1h \
--output json
$SubscriptionId = az account show --query id -o tsv
$ResourceGroup = 'my-rg'
$SandboxGroup = 'my-sandbox-group'
$ResourceId = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroup/providers/Microsoft.App/sandboxGroups/$SandboxGroup"
az rest --method get `
--url "https://management.azure.com${ResourceId}?api-version=2026-07-01" `
--query properties.enableDetailedMetrics --output json
az monitor metrics list-definitions `
--resource $ResourceId `
--output json
az monitor metrics list `
--resource $ResourceId `
--namespace Microsoft.App/sandboxGroups `
--metrics SandboxGroup.RunningCores SandboxGroup.RunningMemoryGiB `
--aggregation Average Maximum `
--interval 1m --offset 1h `
--output json
Enable per-sandbox metrics
Set the sandbox group's ARM property properties.enableDetailedMetrics to true.
Use PATCH to change this setting without changing other group settings. PUT can reset settings you leave out.
Enabling detailed metrics creates separate time series for each running sandbox. Groups with many sandboxes can produce high-cardinality metric data; enable it when you need that level of detail.
- Bash
- PowerShell
az rest --method patch \
--url "https://management.azure.com${RESOURCE_ID}?api-version=2026-07-01" \
--body '{"properties":{"enableDetailedMetrics":true}}' \
--output json
'{"properties":{"enableDetailedMetrics":true}}' | az rest --method patch `
--url "https://management.azure.com${ResourceId}?api-version=2026-07-01" `
--body '@-' `
--output json
Allow up to five minutes for opt-in to take effect, plus Azure Monitor ingestion delay, before expecting detailed samples.
Query individual sandboxes
The first query uses SandboxId eq '*' to return separate series. The second filters to one sandbox: replace <sandbox-id> with the exact ID from the sandbox's detail or creation output, not its name or label. See how to capture a sandbox ID.
- Bash
- PowerShell
az monitor metrics list \
--resource "$RESOURCE_ID" \
--namespace Microsoft.App/sandboxGroups \
--metrics Sandbox.AssignedCores Sandbox.AssignedMemoryGiB \
--aggregation Average \
--filter "SandboxId eq '*'" --top 100 \
--interval 1m --offset 1h \
--output json
SANDBOX_ID="<sandbox-id>"
az monitor metrics list \
--resource "$RESOURCE_ID" \
--namespace Microsoft.App/sandboxGroups \
--metrics Sandbox.AssignedCores Sandbox.AssignedMemoryGiB \
--aggregation Average \
--filter "SandboxId eq '$SANDBOX_ID'" \
--interval 1m --offset 1h \
--output json
az monitor metrics list `
--resource $ResourceId `
--namespace Microsoft.App/sandboxGroups `
--metrics Sandbox.AssignedCores Sandbox.AssignedMemoryGiB `
--aggregation Average `
--filter "SandboxId eq '*'" --top 100 `
--interval 1m --offset 1h `
--output json
$SandboxId = '<sandbox-id>'
az monitor metrics list `
--resource $ResourceId `
--namespace Microsoft.App/sandboxGroups `
--metrics Sandbox.AssignedCores Sandbox.AssignedMemoryGiB `
--aggregation Average `
--filter "SandboxId eq '$SandboxId'" `
--interval 1m --offset 1h `
--output json
With a filter, Azure CLI defaults to returning the top 10 series. --top 100 raises the limit, but it is not an exhaustive inventory of sandboxes. Use an exact SandboxId filter when you need to inspect a specific sandbox.