{"record":{"id":"1be55399a0be6962","repo":"microsoft/aspire","slug":"the-endpoint-s-string-join-unsupportedendpoints-select-r-r-1be553","errorCode":null,"errorMessage":"The endpoint(s) {string.Join(\", \", unsupportedEndpoints.Select(r => $\"'{r.Endpoint.Name}'\"))} on resource '{resource.Name}' specifies an unsupported scheme. Only http and https are supported in App Service.","messagePattern":"The endpoint\\(s\\) (.+?)'\"\\)\\)\\} on resource '(.+?)' specifies an unsupported scheme\\. Only http and https are supported in App Service\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Azure.AppService/AzureAppServiceWebsiteContext.cs","lineNumber":107,"sourceCode":"            }\n        }\n    }\n\n    private void ProcessEndpoints()\n    {\n        // Resolve endpoint ports using the centralized helper\n        var resolvedEndpoints = resource.ResolveEndpoints();\n\n        if (resolvedEndpoints.Count == 0)\n        {\n            return;\n        }\n\n        // Only http/https are supported in App Service\n        var unsupportedEndpoints = resolvedEndpoints.Where(r => r.Endpoint.UriScheme is not (\"http\" or \"https\")).ToArray();\n        if (unsupportedEndpoints.Length > 0)\n        {\n            throw new NotSupportedException($\"The endpoint(s) {string.Join(\", \", unsupportedEndpoints.Select(r => $\"'{r.Endpoint.Name}'\"))} on resource '{resource.Name}' specifies an unsupported scheme. Only http and https are supported in App Service.\");\n        }\n\n        // App Service supports only one target port\n        var targetPortEndpoints = resolvedEndpoints\n            .Where(r => r.Endpoint.IsExternal)\n            .Select(r => r.TargetPort.Value)\n            .Distinct()\n            .ToList();\n\n        if (targetPortEndpoints.Count > 1)\n        {\n            throw new NotSupportedException(\"App Service does not support resources with multiple external endpoints.\");\n        }\n\n        var preserveHttp = environmentContext.Environment.PreserveHttpEndpoints;\n\n        foreach (var resolved in resolvedEndpoints)\n        {","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Azure.AppService/AzureAppServiceWebsiteContext.cs#L89-L125","documentation":"During ProcessEndpoints, AzureAppServiceWebsiteContext validates that every endpoint on the project uses http or https, because Azure App Service front-ends only expose those schemes. If any resolved endpoint uses another UriScheme (e.g. tcp, udp), a NotSupportedException is thrown naming the offending endpoints and resource.","triggerScenarios":"A project resource being published to App Service has an endpoint declared with WithEndpoint/scheme other than http/https — e.g. endpoint1.WithPort(808, \"tcp\") or a custom scheme — and the resource is processed by the AppService publish transformer.","commonSituations":"Projects that also expose gRPC-over-TCP, database ports, or custom service endpoints that work locally under the app host but are illegal on App Service; copy-pasted WithEndpoint calls with scheme \"tcp\"; forgetting that only the HTTP(S) front-end is modeled.","solutions":["Change unsupported endpoints to scheme \"http\" or \"https\" in the AppService-published project.","Remove endpoints that are not meant to be exposed publicly (non-external service-to-service ports) before publishing to App Service.","Split the workload: keep non-HTTP endpoints in a container-based deployment target instead of App Service."],"exampleFix":"// before\nbuilder.AddProject<Projects.Api>(\"api\").WithEndpoint(\"metrics\", e => e.WithScheme(\"tcp\"));\n// after\nbuilder.AddProject<Projects.Api>(\"api\")\n    .WithEndpoint(\"metrics\", e => { e.WithScheme(\"http\"); e.WithExternalHttpEndpoints(); });","handlingStrategy":"validation","validationCode":"var bad = project.Annotations.OfType<EndpointAnnotation>()\n    .Where(e => e.UriScheme is not (\"http\" or \"https\")).ToList();\nif (bad.Count > 0)\n    throw new NotSupportedException($\"Endpoints [{string.Join(\", \", bad.Select(b => b.Name))}] must be http/https for App Service.\");","typeGuard":null,"tryCatchPattern":"try { await environmentContext.ProcessAsync(); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"unsupported scheme\"))\n{\n    logger.LogError(ex, \"Project has non-HTTP(S) endpoints; fix schemes before publishing to App Service.\");\n    throw;\n}","preventionTips":["Declare only http/https endpoints on projects targeted at App Service.","Keep non-HTTP endpoints (tcp/grpc raw) out of AppService-published projects or move them to a container target.","Review WithEndpoint calls with explicit scheme arguments during migration to App Service."],"tags":["azure-app-service","endpoint","scheme","validation"],"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"}