Is there an existing issue for this?
Describe the bug
publishAsAzureSandbox / PublishAsAzureSandbox with AzureSandboxTier.Small or AzureSandboxTier.ExtraSmall always fails during aspire deploy. The Medium, Large, and ExtraLarge tiers work.
AzureSandboxContainerDeployment.CreateSandboxResources sends Disk = "20480Mi" for Small and ExtraSmall:
AzureSandboxTier.ExtraSmall => new() { Cpu = "250m", Memory = "512Mi", Disk = "20480Mi" },
AzureSandboxTier.Small => new() { Cpu = "500m", Memory = "1024Mi", Disk = "20480Mi" },
The sandbox data-plane API allows at most cores × 20 GiB of disk, so Small gets 10 GiB and ExtraSmall gets 5 GiB. It rejects the create-sandbox request:
{"title":"InvalidResourceTier","status":400,"detail":"Disk size '20480Mi' exceeds tier maximum for CPU=500m. Maximum disk for this tier is 10Gi (cores × 20Gi).","errorCode":18}
The generated AzureSandboxTier docs make the same mistake (ExtraSmall = "0.25 vCPU, 0.5 GiB memory, and 20 GiB disk", Small = "0.5 vCPU, 1 GiB memory, and 20 GiB disk").
Aspire redacts the error body (tracked separately), so users only see HTTP 400 (Bad Request). The service returned an error response whose details were redacted.
cc Shayne Boyer (@spboyer)
Expected Behavior
Every documented tier deploys. Small and ExtraSmall should request a disk size within the service limit, or leave it out and let the service pick its default. When disk is omitted with cpu: 500m, the service returned disk: 10240Mi.
Steps To Reproduce
TypeScript AppHost with aspire add Aspire.Hosting.Azure.Sandboxes:
import { AzureSandboxTier, createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();
await builder.addAzureSandboxGroup("sandboxes");
await builder.addContainer("site", "nginx:alpine")
.withHttpEndpoint({ name: "http", targetPort: 80 })
.withExternalHttpEndpoints()
.publishAsAzureSandbox({
tier: AzureSandboxTier.Small,
endpoints: [{ name: "http", anonymous: true }],
});
await builder.build().run();
$env:Azure__SubscriptionId='<sub>'; $env:Azure__Location='westus3'; $env:Azure__ResourceGroup='<rg>'
aspire deploy --non-interactive
Result: deploy-site-sandbox-container fails with HTTP 400. With AzureSandboxTier.Medium or Large the same AppHost deploys. ExtraSmall fails the same way as Small.
This reproduces in two subscriptions and two separate deployments in westus3. Sending the same request directly to the data plane with disk: 20480Mi returns the InvalidResourceTier error above. Sending it with disk omitted succeeds.
Exceptions (if any)
(deploy-site-sandbox-container) ✗ Step 'deploy-site-sandbox-container' failed: ADC request 'PUT
subscriptions/<sub>/resourceGroups/<rg>/sandboxGroups/<group>/sandboxes' failed
with HTTP 400 (Bad Request). The service returned an error response whose details were redacted.
Anything else?
- Aspire CLI and packages: 14.0.0-preview.1.26473.8 (daily)
- API version:
2026-02-01-preview, region westus3
- Code:
src/Aspire.Hosting.Azure.Sandboxes/AzureSandboxContainerDeployment.cs (CreateSandboxResources) and the AzureSandboxTier XML docs
- The deployment E2E tests only use the default Medium tier, so CI doesn't catch this. A unit test pinning the per-tier resource values against
cores × 20Gi would.
Is there an existing issue for this?
Describe the bug
publishAsAzureSandbox/PublishAsAzureSandboxwithAzureSandboxTier.SmallorAzureSandboxTier.ExtraSmallalways fails duringaspire deploy. The Medium, Large, and ExtraLarge tiers work.AzureSandboxContainerDeployment.CreateSandboxResourcessendsDisk = "20480Mi"for Small and ExtraSmall:The sandbox data-plane API allows at most cores × 20 GiB of disk, so Small gets 10 GiB and ExtraSmall gets 5 GiB. It rejects the create-sandbox request:
{"title":"InvalidResourceTier","status":400,"detail":"Disk size '20480Mi' exceeds tier maximum for CPU=500m. Maximum disk for this tier is 10Gi (cores × 20Gi).","errorCode":18}The generated
AzureSandboxTierdocs make the same mistake (ExtraSmall= "0.25 vCPU, 0.5 GiB memory, and 20 GiB disk",Small= "0.5 vCPU, 1 GiB memory, and 20 GiB disk").Aspire redacts the error body (tracked separately), so users only see
HTTP 400 (Bad Request). The service returned an error response whose details were redacted.cc Shayne Boyer (@spboyer)
Expected Behavior
Every documented tier deploys. Small and ExtraSmall should request a disk size within the service limit, or leave it out and let the service pick its default. When
diskis omitted withcpu: 500m, the service returneddisk: 10240Mi.Steps To Reproduce
TypeScript AppHost with
aspire add Aspire.Hosting.Azure.Sandboxes:Result:
deploy-site-sandbox-containerfails with HTTP 400. WithAzureSandboxTier.MediumorLargethe same AppHost deploys.ExtraSmallfails the same way asSmall.This reproduces in two subscriptions and two separate deployments in westus3. Sending the same request directly to the data plane with
disk: 20480Mireturns theInvalidResourceTiererror above. Sending it withdiskomitted succeeds.Exceptions (if any)
Anything else?
2026-02-01-preview, region westus3src/Aspire.Hosting.Azure.Sandboxes/AzureSandboxContainerDeployment.cs(CreateSandboxResources) and theAzureSandboxTierXML docscores × 20Giwould.