Skip to content
Docs Try Aspire

EndpointAnnotation

Class sealed net10.0
📦 Aspire.Hosting v13.1.2
Represents an endpoint annotation that describes how a service should be bound to a network.
namespace Aspire.Hosting.ApplicationModel;
public sealed class EndpointAnnotation
: Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
// ...
}
This class is used to specify the network protocol, port, URI scheme, transport, and other details for a service.
View all constructors
AllAllocatedEndpointsget
Gets the list of all AllocatedEndpoints associated with this Endpoint.
AllocatedEndpointget; set
Gets or sets the default EndpointAnnotation.AllocatedEndpoint for this Endpoint.
AllocatedEndpointSnapshotget
ValueSnapshot<AllocatedEndpoint>
DefaultNetworkIDget
Gets the ID of the network that is the "default" network for the Endpoint (the one the Endpoint is associated with and can be reached without routing or network address translation).
IsExternalget; set
bool
Indicates that this endpoint should be exposed externally at publish time.
IsProxiedget; set
bool
Indicates that this endpoint should be managed by DCP. This means it can be replicated and use a different port internally than the one publicly exposed. Setting to false means the endpoint will be handled and exposed by the resource.
Nameget; set
string
Name of the service
Portget; set
int?
Desired port for the service
Protocolget; set
ProtocolType
Network protocol: TCP or UDP are supported today, others possibly in future.
TargetHostget; set
string
This is the address the resource is listening on. By default it is localhost.
TargetPortget; set
int?
This is the port the resource is listening on. If the endpoint is used for the container, it is the container port.
Transportget; set
string
Transport that is being used (e.g. http, http2, http3 etc).
UriSchemeget; set
string
If a service is URI-addressable, this property will contain the URI scheme to use for constructing service URI.
View all properties