{"record":{"id":"0682c860433d71aa","repo":"microsoft/aspire","slug":"unsupported-endpoint-property-property","errorCode":null,"errorMessage":"Unsupported endpoint property {property}","messagePattern":"Unsupported endpoint property (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Azure.AppService/AzureAppServiceWebsiteContext.cs","lineNumber":874,"sourceCode":"        infra.Add(new AspireSiteNetworkConfig(\"webappNetworkConfig\")\n        {\n            Parent = webSite,\n            SubnetResourceId = webSite.VirtualNetworkSubnetId\n        });\n    }\n\n    private BicepValue<string> GetEndpointValue(EndpointMapping mapping, EndpointProperty property)\n    {\n        return property switch\n        {\n            EndpointProperty.Url => BicepFunction.Interpolate($\"{mapping.Scheme}://{mapping.Host}.azurewebsites.net\"),\n            EndpointProperty.Host => BicepFunction.Interpolate($\"{mapping.Host}.azurewebsites.net\"),\n            EndpointProperty.Port => mapping.Port.ToString(CultureInfo.InvariantCulture),\n            EndpointProperty.TargetPort => mapping.TargetPort?.ToString(CultureInfo.InvariantCulture) ?? (BicepValue<string>)AllocateParameter(new ContainerPortReference(Resource)),\n            EndpointProperty.Scheme => mapping.Scheme,\n            EndpointProperty.HostAndPort => BicepFunction.Interpolate($\"{mapping.Host}.azurewebsites.net\"),\n            EndpointProperty.IPV4Host => BicepFunction.Interpolate($\"{mapping.Host}.azurewebsites.net\"),\n            _ => throw new NotSupportedException($\"Unsupported endpoint property {property}\")\n        };\n    }\n\n    private BicepValue<string> AllocateKeyVaultSecretUriReference(IAzureKeyVaultSecretReference secretReference)\n    {\n        var secret = secretReference.AsKeyVaultSecret(Infra);\n\n        // https://learn.microsoft.com/azure/app-service/app-service-key-vault-references?tabs=azure-cli#-understand-source-app-settings-from-key-vault\n        return secret.Properties.SecretUri;\n    }\n\n    private ProvisioningParameter AllocateParameter(IManifestExpressionProvider parameter, SecretType secretType = SecretType.None)\n    {\n        return parameter.AsProvisioningParameter(Infra, isSecure: secretType == SecretType.Normal);\n    }\n\n    private RoleAssignment AddDashboardPermissionAndSettings(object webSite, ProvisioningParameter acrClientIdParameter, bool isSlot, BicepValue<string>? deploymentSlot = null)\n    {","sourceCodeStart":856,"sourceCodeEnd":892,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Azure.AppService/AzureAppServiceWebsiteContext.cs#L856-L892","documentation":"GetEndpointValue maps an EndpointProperty to an actual value for a resolved App Service endpoint (host under azurewebsites.net, port 80/443, scheme, target port). When the requested EndpointProperty is not one of the handled members, the discard arm throws this NotSupportedException with the property name.","triggerScenarios":"Requesting EndpointProperty values such as IPV4Host or HostAndPort... wait, HostAndPort/IPV4Host are handled — the failing case is any other member (e.g. Host of an unrecognized kind, TlsEnabled, or a new EndpointProperty enum member added in a newer Aspire version that this switch doesn't cover), typically from ProcessValue resolving endpoint-derived environment values.","commonSituations":"Version skew where a newer Aspire.Hosting adds an EndpointProperty member while the AppService context wasn't updated; custom code requesting endpoint properties that have no App Service representation; endpoint references (e.g. from GetEndpoint(\"...\") expressions) flowing into website environment variables with properties App Service can't express.","solutions":["Restrict endpoint property references to supported ones: Host, Port, TargetPort, Scheme, HostAndPort, IPV4Host.","Align Aspire.Hosting and Aspire.Hosting.Azure.AppService package versions.","Compute the value manually instead of via endpoint references (e.g. hardcode the azurewebsites.net host expression).","If a new EndpointProperty is needed, add a mapping arm to GetEndpointValue."],"exampleFix":"// before\nvar v = websiteContext.GetEndpointValue(mapping, EndpointProperty.IPV4HostFallback); // hypothetical new member\n// after\nvar v = websiteContext.GetEndpointValue(mapping, EndpointProperty.Host); // {host}.azurewebsites.net","handlingStrategy":"validation","validationCode":"static bool IsSupportedGetEndpointValueProperty(EndpointProperty p) =>\n    p is EndpointProperty.Host or EndpointProperty.Port or EndpointProperty.TargetPort\n        or EndpointProperty.Scheme or EndpointProperty.HostAndPort or EndpointProperty.IPV4Host;","typeGuard":"if (property is not (EndpointProperty.Host or EndpointProperty.Port or EndpointProperty.TargetPort or EndpointProperty.Scheme or EndpointProperty.HostAndPort or EndpointProperty.IPV4Host))\n    throw new ArgumentException($\"{property} has no App Service endpoint mapping.\");","tryCatchPattern":"try { var v = ctx.GetEndpointValue(mapping, property); }\ncatch (NotSupportedException ex) when (ex.Message.StartsWith(\"Unsupported endpoint property\"))\n{\n    logger.LogWarning(\"Falling back to Host for {Property}\", property);\n    var v = ctx.GetEndpointValue(mapping, EndpointProperty.Host);\n}","preventionTips":["Use only Host, Port, TargetPort, Scheme, HostAndPort, IPV4Host when resolving endpoint values for App Service.","Keep Azure.AppService package versions in sync with Aspire.Hosting so new enum members are mapped.","Prefer explicit site host expressions ({host}.azurewebsites.net) over exotic endpoint properties."],"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"}