{"record":{"id":"6cceee01cb6ba495","repo":"microsoft/aspire","slug":"endpoint-resolvedendpoint-endpoint-name-on-resource-resource-6cceee","errorCode":null,"errorMessage":"Endpoint '{resolvedEndpoint.Endpoint.Name}' on resource '{resource.TargetResource.Name}' shares target port {resolvedTargetPort} with endpoint '{existingEndpoint.Name}' but uses a different transport. Azure sandbox ports support a single HTTP protocol per target port.","messagePattern":"Endpoint '(.+?)' on resource '(.+?)' shares target port (.+?) with endpoint '(.+?)' but uses a different transport\\. Azure sandbox ports support a single HTTP protocol per target port\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Azure.Sandboxes/AzureSandboxContainerDeployment.cs","lineNumber":1525,"sourceCode":"            }\n\n            var protocol = ResolveSandboxPortProtocol(resource.TargetResource, resolvedEndpoint.Endpoint);\n            AzureSandboxEndpointOptions? resolvedEndpointOptions = null;\n            endpointOptions?.TryGetValue(resolvedEndpoint.Endpoint.Name, out resolvedEndpointOptions);\n            unmatchedEndpointOptions?.Remove(resolvedEndpoint.Endpoint.Name);\n            var endpoint = new SandboxEndpoint(\n                resolvedEndpoint.Endpoint.Name,\n                resolvedTargetPort,\n                IsExternal: true,\n                IsHttp: true,\n                protocol,\n                resolvedEndpointOptions?.Anonymous);\n\n            if (endpoints.TryGetValue(resolvedTargetPort, out var existingEndpoint))\n            {\n                if (!string.Equals(existingEndpoint.Protocol, endpoint.Protocol, StringComparison.Ordinal))\n                {\n                    throw new NotSupportedException($\"Endpoint '{resolvedEndpoint.Endpoint.Name}' on resource '{resource.TargetResource.Name}' shares target port {resolvedTargetPort} with endpoint '{existingEndpoint.Name}' but uses a different transport. Azure sandbox ports support a single HTTP protocol per target port.\");\n                }\n\n                if (existingEndpoint.Anonymous is not null &&\n                    endpoint.Anonymous is not null &&\n                    existingEndpoint.Anonymous != endpoint.Anonymous)\n                {\n                    throw new NotSupportedException($\"Endpoint '{resolvedEndpoint.Endpoint.Name}' on resource '{resource.TargetResource.Name}' shares target port {resolvedTargetPort} with endpoint '{existingEndpoint.Name}' but configures a different anonymous-access policy. Azure sandbox ports support a single access policy per target port.\");\n                }\n\n                endpoints[resolvedTargetPort] = existingEndpoint with\n                {\n                    IsExternal = existingEndpoint.IsExternal || endpoint.IsExternal,\n                    IsHttp = existingEndpoint.IsHttp || endpoint.IsHttp,\n                    Anonymous = existingEndpoint.Anonymous ?? endpoint.Anonymous\n                };\n            }\n            else\n            {","sourceCodeStart":1507,"sourceCodeEnd":1543,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Azure.Sandboxes/AzureSandboxContainerDeployment.cs#L1507-L1543","documentation":"Each Azure sandbox target port maps to a single ingress protocol. If two endpoints share the same target port but declare different transports (e.g. http vs http2), the sandbox cannot represent both, so NotSupportedException is thrown.","triggerScenarios":"Two EndpointAnnotations on resources in the sandbox resolve to the same resolvedTargetPort key but their resolved protocol strings differ (string comparison).","commonSituations":"Adding both an http and an http2 endpoint pointing at the same container port; multiple resources sharing a port with different transport settings from WithEndpoint(transport: ...).","solutions":["Make both endpoints use the same transport for the shared target port","Move one endpoint to a different target port","Remove the redundant endpoint"],"exampleFix":"// before\n.WithHttpEndpoint(targetPort: 8080)\n.WithEndpoint(scheme: \"http\", transport: \"http2\", targetPort: 8080)\n// after\n.WithHttpEndpoint(targetPort: 8080)\n.WithHttpEndpoint(targetPort: 8081)","handlingStrategy":"validation","validationCode":"var byPort = resource.Endpoints.GroupBy(e => e.TargetPort)\n    .Where(g => g.Select(e => e.Transport).Distinct().Count() > 1);\nif (byPort.Any()) throw new InvalidOperationException(\"Shared target port with mixed transports.\");","typeGuard":null,"tryCatchPattern":"try { DeploySandbox(...); } catch (NotSupportedException ex) when (ex.Message.Contains(\"single HTTP protocol per target port\")) { /* unify transports or split ports */ }","preventionTips":["One transport per target port across all sandbox endpoints","Audit WithEndpoint transport values when reusing ports"],"tags":["azure","sandbox","endpoint","port-conflict","transport"],"backgroundTag":"conflicting-config-options","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"}