microsoft/aspire · error · InvalidOperationException

The property ' ' is not supported for the endpoint ' '.

Error message

The property '{property}' is not supported for the endpoint '{endpoint.Name}'.

What it means

When resolving endpoint property expressions for Container Apps (used in Bicep generation), GetEndpointPropertyExpression supports only known EndpointProperty values (Host, Port, TargetPort, Scheme, HostAndPort, TlsEnabled, etc.). An unrecognized property falls into the default arm and throws this InvalidOperationException naming the property and endpoint.

Solutions

  1. Align all Aspire.Hosting.Azure.* package versions so the EndpointProperty enum is consistent
  2. Avoid requesting unsupported endpoint properties for Container App endpoints; use a supported property (Host, Port, Scheme, etc.)
  3. Upgrade to an Aspire version where the property you need is handled

Example fix

// before
var expr = envResource.GetEndpointPropertyExpression(endpoint, EndpointProperty.HttpsDisabled);
// after
var expr = envResource.GetEndpointPropertyExpression(endpoint, EndpointProperty.Scheme);
Defensive patterns

Strategy: validation

Validate before calling

var supported = new[] { EndpointProperty.Host, EndpointProperty.Port, EndpointProperty.TargetPort, EndpointProperty.Scheme, EndpointProperty.HostAndPort, EndpointProperty.TlsEnabled };
if (!supported.Contains(property))
{
    throw new NotSupportedException($"{property} is not supported for Container App endpoints");
}

Try / catch

try { var expr = env.GetEndpointPropertyExpression(endpoint, property); }
catch (InvalidOperationException ex) when (ex.Message.Contains("not supported"))
{
    logger.LogError(ex, "Unsupported endpoint property {Property}", property);
}

Prevention

When it happens

Trigger: A switch arm lookup for an EndpointProperty not handled for Container App endpoints — typically a new EndpointProperty enum member added in a newer Aspire version while this code path handles only the existing set, or a caller requesting a property the Container App environment cannot express.

Common situations: Version mismatch between Aspire packages that share the EndpointProperty enum, custom extensions requesting unusual endpoint properties during publish, or generating Bicep for endpoints whose properties were not extended for Container Apps.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16). Data as JSON: /api/errors/fa3705ed6b252789. Report an issue: GitHub.

Appendix: source

Thrown at src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppEnvironmentResource.cs:387

        var property = endpointReferenceExpression.Property;
        var endpoint = endpointReference.EndpointAnnotation;
        var scheme = PreserveHttpEndpoints ? endpoint.UriScheme : "https";
        var port = string.Equals(scheme, "http", StringComparison.OrdinalIgnoreCase) ? 80 : 443;
        var tlsEnabled = string.Equals(scheme, "https", StringComparison.OrdinalIgnoreCase) || endpoint.TlsEnabled;
        var host = GetHostAddressExpression(endpointReference);

        return property switch
        {
            EndpointProperty.Url => ReferenceExpression.Create($"{scheme}://{host}"),
            EndpointProperty.Host or EndpointProperty.IPV4Host => host,
            EndpointProperty.Port => ReferenceExpression.Create($"{port.ToString(CultureInfo.InvariantCulture)}"),
            EndpointProperty.TargetPort => endpoint.TargetPort is int targetPort
                ? ReferenceExpression.Create($"{targetPort.ToString(CultureInfo.InvariantCulture)}")
                : ReferenceExpression.Create($"{new ContainerPortReference(endpointReference.Resource)}"),
            EndpointProperty.Scheme => ReferenceExpression.Create($"{scheme}"),
            EndpointProperty.HostAndPort => ReferenceExpression.Create($"{host}:{port.ToString(CultureInfo.InvariantCulture)}"),
            EndpointProperty.TlsEnabled => ReferenceExpression.Create($"{(tlsEnabled ? bool.TrueString : bool.FalseString)}"),
            _ => throw new InvalidOperationException($"The property '{property}' is not supported for the endpoint '{endpoint.Name}'.")
        };
    }

    internal BicepOutputReference GetVolumeStorage(IResource resource, ContainerMountAnnotation volume, int volumeIndex)
    {
        var prefix = volume.Type switch
        {
            ContainerMountType.BindMount => "bindmounts",
            ContainerMountType.Volume => "volumes",
            _ => throw new NotSupportedException()
        };

        // REVIEW: Should we use the same naming algorithm as azd?
        // Normalize the resource name to ensure it's compatible with Bicep identifiers (only letters, numbers, and underscores)
        var normalizedResourceName = Infrastructure.NormalizeBicepIdentifier(resource.Name);
        var outputName = $"{prefix}_{normalizedResourceName}_{volumeIndex}";

        if (!VolumeNames.TryGetValue(outputName, out var volumeName))

View on GitHub (pinned to 25830f84bd)