{"record":{"id":"4fb887ee6b0586d9","repo":"microsoft/aspire","slug":"the-property-property-is-not-supported-for-the-endpoint-4fb887","errorCode":null,"errorMessage":"The property '{property}' is not supported for the endpoint '{endpoint.Name}'.","messagePattern":"The property '(.+?)' is not supported for the endpoint '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentResource.cs","lineNumber":539,"sourceCode":"        var property = endpointReferenceExpression.Property;\n        var endpoint = endpointReference.EndpointAnnotation;\n        var scheme = PreserveHttpEndpoints ? endpoint.UriScheme : \"https\";\n        var port = string.Equals(scheme, \"http\", StringComparison.OrdinalIgnoreCase) ? 80 : 443;\n        var tlsEnabled = string.Equals(scheme, \"https\", StringComparison.OrdinalIgnoreCase) || endpoint.TlsEnabled;\n        var host = GetHostAddressExpression(endpointReference);\n\n        return property switch\n        {\n            EndpointProperty.Url => ReferenceExpression.Create($\"{scheme}://{host}\"),\n            EndpointProperty.Host or EndpointProperty.IPV4Host => host,\n            EndpointProperty.Port => ReferenceExpression.Create($\"{port.ToString(CultureInfo.InvariantCulture)}\"),\n            EndpointProperty.TargetPort => endpoint.TargetPort is int targetPort\n                ? ReferenceExpression.Create($\"{targetPort.ToString(CultureInfo.InvariantCulture)}\")\n                : ReferenceExpression.Create($\"{new ContainerPortReference(endpointReference.Resource)}\"),\n            EndpointProperty.Scheme => ReferenceExpression.Create($\"{scheme}\"),\n            EndpointProperty.HostAndPort => host,\n            EndpointProperty.TlsEnabled => ReferenceExpression.Create($\"{(tlsEnabled ? bool.TrueString : bool.FalseString)}\"),\n            _ => throw new InvalidOperationException($\"The property '{property}' is not supported for the endpoint '{endpoint.Name}'.\")\n        };\n    }\n\n    /// <inheritdoc/>\n    public override ProvisionableResource AddAsExistingResource(AzureResourceInfrastructure infra)\n    {\n        var bicepIdentifier = this.GetBicepIdentifier();\n        var resources = infra.GetProvisionableResources();\n\n        // Check if an AppServicePlan with the same identifier already exists\n        var existingPlan = resources.OfType<AppServicePlan>().SingleOrDefault(plan => plan.BicepIdentifier == bicepIdentifier);\n\n        if (existingPlan is not null)\n        {\n            return existingPlan;\n        }\n\n        // Create and add new resource if it doesn't exist","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentResource.cs#L521-L557","documentation":"AzureAppServiceEnvironmentResource.GetEndpointPropertyExpression builds ReferenceExpressions for endpoint properties (Host, Port, Scheme, HostAndPort, etc.) used to parameterize App Service resources. When the requested EndpointProperty is not one of the supported members, the switch falls through to its discard arm and throws this InvalidOperationException. It signals that a caller asked for an endpoint property the App Service publishing model cannot express.","triggerScenarios":"Calling GetEndpointPropertyExpression (directly or via publish-model code that resolves endpoint references for App Service) with an EndpointProperty value outside {Host, Port, Scheme, HostAndPort, TlsEnabled, TargetPort} — e.g. IPV4Host or a newly added EndpointProperty enum member that App Service publishing has not been taught to map.","commonSituations":"A newer Aspire version adds an EndpointProperty member (e.g. IPV4Host) and custom publishing code or an older/newer package mix requests it against App Service environments; custom resource/endpoint expression generation in extension code passes an unexpected property; version skew between Aspire.Hosting and Aspire.Hosting.Azure.AppService packages.","solutions":["Check which EndpointProperty value is being requested and only request supported ones: Host, Port, Scheme, HostAndPort, TlsEnabled, TargetPort.","Align Aspire.Hosting and Aspire.Hosting.Azure.AppService package versions so the enum and the switch are from the same release.","If you own the calling code, map the unsupported property yourself (e.g. resolve IPV4Host to the host expression) before calling this API.","If a newly added EndpointProperty is legitimately needed for App Service, update the switch in GetEndpointPropertyExpression to handle it."],"exampleFix":"// before\nvar expr = environmentResource.GetEndpointPropertyExpression(endpointReference, EndpointProperty.IPV4Host, ...);\n// after\n// IPV4Host is not supported for App Service; use Host instead\nvar expr = environmentResource.GetEndpointPropertyExpression(endpointReference, EndpointProperty.Host, ...);","handlingStrategy":"validation","validationCode":"static bool IsSupportedAppServiceEndpointProperty(EndpointProperty p) =>\n    p is EndpointProperty.Host or EndpointProperty.Port or EndpointProperty.Scheme\n        or EndpointProperty.HostAndPort or EndpointProperty.TlsEnabled or EndpointProperty.TargetPort;","typeGuard":"if (property is not (EndpointProperty.Host or EndpointProperty.Port or EndpointProperty.Scheme or EndpointProperty.HostAndPort or EndpointProperty.TlsEnabled or EndpointProperty.TargetPort))\n    throw new ArgumentException($\"{property} is not supported for App Service endpoints.\");","tryCatchPattern":"try { var expr = env.GetEndpointPropertyExpression(epRef, property); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"is not supported for the endpoint\"))\n{\n    logger.LogWarning(ex, \"Unsupported endpoint property {Property}; falling back to Host\", property);\n    expr = env.GetEndpointPropertyExpression(epRef, EndpointProperty.Host);\n}","preventionTips":["Only reference endpoint properties the App Service model supports (Host, Port, Scheme, HostAndPort, TlsEnabled, TargetPort).","Keep Aspire.Hosting and Aspire.Hosting.Azure.AppService packages on identical versions.","When a new EndpointProperty ships, grep AppService publishing code for the switch before using it."],"tags":["azure-app-service","endpoint","unsupported-operation","publishing"],"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"}