# EndpointAnnotation Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [EndpointAnnotation](/reference/api/csharp/aspire.hosting/endpointannotation.md)
- Kind: `Properties`
- Members: `15`

Represents an endpoint annotation that describes how a service should be bound to a network.

## AllAllocatedEndpoints

- Name: `AllAllocatedEndpoints`
- Modifiers: `get`
- Returns: [NetworkEndpointSnapshotList](/reference/api/csharp/aspire.hosting/networkendpointsnapshotlist.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs#L280)

Gets the list of all AllocatedEndpoints associated with this Endpoint.

```csharp
public NetworkEndpointSnapshotList AllAllocatedEndpoints { get; }
```

## AllocatedEndpoint

- Name: `AllocatedEndpoint`
- Modifiers: `nullable` `get; set`
- Returns: [AllocatedEndpoint?](/reference/api/csharp/aspire.hosting/allocatedendpoint.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

Gets or sets the default [EndpointAnnotation.AllocatedEndpoint](/reference/api/csharp/aspire.hosting/endpointannotation/properties.md#allocatedendpoint) for this Endpoint.

```csharp
public AllocatedEndpoint? AllocatedEndpoint { get; set; }
```

## AllocatedEndpointSnapshot

> **Obsolete:** This property will be marked as internal in future Aspire release. Use AllocatedEndpoint and AllAllocatedEndpoints properties to access and change allocated endpoints associated with an EndpointAnnotation.

- Name: `AllocatedEndpointSnapshot`
- Modifiers: `get`
- Returns: `ValueSnapshot<AllocatedEndpoint>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs#L275)

Gets the [EndpointAnnotation.AllocatedEndpointSnapshot](/reference/api/csharp/aspire.hosting/endpointannotation/properties.md#allocatedendpointsnapshot) for the default [EndpointAnnotation.AllocatedEndpoint](/reference/api/csharp/aspire.hosting/endpointannotation/properties.md#allocatedendpoint).

```csharp
public ValueSnapshot<AllocatedEndpoint> AllocatedEndpointSnapshot { get; }
```

## DefaultNetworkID

- Name: `DefaultNetworkID`
- Modifiers: `get`
- Returns: [NetworkIdentifier](/reference/api/csharp/aspire.hosting/networkidentifier.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs#L231)

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).

```csharp
public NetworkIdentifier DefaultNetworkID { get; }
```

## ExcludeReferenceEndpoint

- Name: `ExcludeReferenceEndpoint`
- Modifiers: `get; set`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

Gets or sets a value indicating whether this endpoint is excluded from the default set when referencing the resource's endpoints via `WithReference(resource)`. When `true`, the endpoint is excluded from the default set and must be referenced explicitly using `WithReference(resource.GetEndpoint("name"))`.

```csharp
public bool ExcludeReferenceEndpoint { get; set; }
```

## Remarks

Defaults to `false`.

This is useful for resources that expose auxiliary endpoints (e.g., management dashboards, health check ports) that should not be included in service discovery by default.

## IsExternal

- Name: `IsExternal`
- Modifiers: `get; set`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

Indicates that this endpoint should be exposed externally at publish time.

```csharp
public bool IsExternal { get; set; }
```

## IsProxied

- Name: `IsProxied`
- Modifiers: `get; set`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

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.

```csharp
public bool IsProxied { get; set; }
```

## Remarks

Defaults to `true`.

## Name

- Name: `Name`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

Name of the service

```csharp
public string Name { get; set; }
```

## Port

- Name: `Port`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

Desired port for the service

```csharp
public int? Port { get; set; }
```

## Protocol

- Name: `Protocol`
- Modifiers: `get; set`
- Returns: `ProtocolType`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

Network protocol: TCP or UDP are supported today, others possibly in future.

```csharp
public ProtocolType Protocol { get; set; }
```

## TargetHost

- Name: `TargetHost`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

This is the address the resource is listening on. By default it is localhost.

```csharp
public string TargetHost { get; set; }
```

## TargetPort

- Name: `TargetPort`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

This is the port the resource is listening on. If the endpoint is used for the container, it is the container port.

```csharp
public int? TargetPort { get; set; }
```

## Remarks

Defaults to [EndpointAnnotation.Port](/reference/api/csharp/aspire.hosting/endpointannotation/properties.md#port).

## TlsEnabled

- Name: `TlsEnabled`
- Modifiers: `get; set`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

Gets or sets a value indicating whether TLS is enabled for this endpoint.

```csharp
public bool TlsEnabled { get; set; }
```

## Remarks

This property is used to track TLS state on the endpoint so that connection string expressions can dynamically include TLS-related parameters (e.g., `ssl=true` for Redis) at resolution time rather than at expression build time. For HTTP-based endpoints, the [EndpointAnnotation.UriScheme](/reference/api/csharp/aspire.hosting/endpointannotation/properties.md#urischeme) property being set to `https` already implies TLS. This property is primarily useful for non-HTTP protocols (e.g., Redis, databases) that need explicit TLS configuration in their connection strings.

## Transport

- Name: `Transport`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

Transport that is being used (e.g. http, http2, http3 etc).

```csharp
public string Transport { get; set; }
```

## UriScheme

- Name: `UriScheme`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs)

If a service is URI-addressable, this property will contain the URI scheme to use for constructing service URI.

```csharp
public string UriScheme { get; set; }
```
