{"record":{"id":"a612a6ebc2678d4d","repo":"microsoft/aspire","slug":"endpoint-endpoint-name-on-resource-resource-name-uses","errorCode":null,"errorMessage":"Endpoint '{endpoint.Name}' on resource '{resource.Name}' uses transport '{endpoint.Transport}'. Azure sandbox ports currently support only HTTP and HTTP/2 endpoints.","messagePattern":"Endpoint '(.+?)' on resource '(.+?)' uses transport '(.+?)'\\. Azure sandbox ports currently support only HTTP and HTTP/2 endpoints\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Azure.Sandboxes/AzureSandboxContainerDeployment.cs","lineNumber":1582,"sourceCode":"        {\n            return targetPort;\n        }\n\n        // .NET project publishing uses ContainerPortReference for the shared HTTP/HTTPS\n        // destination when no target port is specified. Sandbox ingress terminates TLS,\n        // so both app-model endpoints route to the framework's HTTP container port.\n        return resource is ProjectResource && endpoint.Endpoint.Transport is \"http\" or \"http2\"\n            ? DefaultContainerPort\n            : null;\n    }\n\n    private static string ResolveSandboxPortProtocol(IResource resource, EndpointAnnotation endpoint)\n    {\n        return endpoint.Transport switch\n        {\n            \"http\" => \"Http\",\n            \"http2\" => \"Http2\",\n            _ => throw new NotSupportedException($\"Endpoint '{endpoint.Name}' on resource '{resource.Name}' uses transport '{endpoint.Transport}'. Azure sandbox ports currently support only HTTP and HTTP/2 endpoints.\")\n        };\n    }\n\n    internal static async Task DeleteExistingDeploymentAsync(\n        PipelineStepContext context,\n        IAzureDevComputeClient client,\n        AzureDevComputeResourceScope scope,\n        DeploymentStateSection stateSection,\n        bool throwOnError)\n    {\n        List<Exception>? failures = throwOnError ? [] : null;\n        var sandboxId = stateSection.Data[\"SandboxId\"]?.GetValue<string>();\n        if (!string.IsNullOrWhiteSpace(sandboxId))\n        {\n            try\n            {\n                await DeleteSandboxAsync(context, client, scope, sandboxId, GetStatePorts(stateSection), throwOnError).ConfigureAwait(false);\n            }","sourceCodeStart":1564,"sourceCodeEnd":1600,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Azure.Sandboxes/AzureSandboxContainerDeployment.cs#L1564-L1600","documentation":"Sandbox ingress ports only support HTTP and HTTP/2. ResolveSandboxPortProtocol maps transport strings 'http'/'http2' to protocol values and throws NotSupportedException for any other transport (e.g. tcp, udp), since those cannot be exposed via the HTTP-based sandbox ingress.","triggerScenarios":"An endpoint with Transport set to something other than \"http\" or \"http2\" (e.g. WithEndpoint(transport: \"tcp\")) on a resource deployed to an Azure sandbox.","commonSituations":"Exposing TCP services (databases, gRPC-over-TCP with transport \"tcp\") through sandbox ingress; default transport assumptions differing between local run and sandbox deploy.","solutions":["Change the endpoint transport to \"http\" or \"http2\"","Remove the non-HTTP endpoint from sandbox deployment (keep it internal only)","If non-HTTP exposure is required, use a deployment target that supports raw TCP ports"],"exampleFix":"// before\n.WithEndpoint(targetPort: 1433, transport: \"tcp\")\n// after\n.WithHttpEndpoint(targetPort: 8080)","handlingStrategy":"validation","validationCode":"foreach (var ep in resource.Endpoints)\n    if (ep.Transport is not (\"http\" or \"http2\"))\n        throw new InvalidOperationException($\"Endpoint '{ep.Name}' transport '{ep.Transport}' unsupported for sandbox.\");","typeGuard":null,"tryCatchPattern":"try { DeploySandbox(...); } catch (NotSupportedException ex) when (ex.Message.Contains(\"only HTTP and HTTP/2 endpoints\")) { /* switch transport to http/http2 */ }","preventionTips":["Restrict sandbox-deployed endpoints to http/http2 transports","Keep raw TCP services off sandbox ingress"],"tags":["azure","sandbox","endpoint","transport","unsupported"],"backgroundTag":"unsupported-enum-value","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}