Skip to content

Azure Sandboxes: Small and ExtraSmall tiers always fail to deploy (disk request exceeds tier maximum) #20459

Description

Is there an existing issue for this?

  • I have searched the existing issues

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions