Share via


EndpointReference Class

Definition

Represents an endpoint reference for a resource with endpoints.

public sealed class EndpointReference : Aspire.Hosting.ApplicationModel.IManifestExpressionProvider, Aspire.Hosting.ApplicationModel.IValueProvider, Aspire.Hosting.ApplicationModel.IValueWithReferences
type EndpointReference = class
    interface IManifestExpressionProvider
    interface IValueProvider
    interface IValueWithReferences
Public NotInheritable Class EndpointReference
Implements IManifestExpressionProvider, IValueProvider, IValueWithReferences
Inheritance
EndpointReference
Implements

Constructors

EndpointReference(IResourceWithEndpoints, EndpointAnnotation, NetworkIdentifier)

Creates a new instance of EndpointReference with the specified endpoint name.

EndpointReference(IResourceWithEndpoints, EndpointAnnotation)

Creates a new instance of EndpointReference with the specified endpoint name.

EndpointReference(IResourceWithEndpoints, String, NetworkIdentifier)

Creates a new instance of EndpointReference with the specified endpoint name.

EndpointReference(IResourceWithEndpoints, String)

Creates a new instance of EndpointReference with the specified endpoint name.

Properties

ContainerHost

Gets the container host for this endpoint.

ContextNetworkID

The ID of the network that serves as the context for the EndpointReference. The reference will be resolved in the context of this network, which may be different from the network associated with the default network of the referenced Endpoint.

EndpointAnnotation

Gets the endpoint annotation associated with the endpoint reference.

EndpointName

Gets the name of the endpoint associated with the endpoint reference.

ErrorMessage

Gets or sets a custom error message to be thrown when the endpoint annotation is not found.

Exists

Gets a value indicating whether the endpoint exists.

Host

Gets the host for this endpoint.

IsAllocated

Gets a value indicating whether the endpoint is allocated.

Port

Gets the port for this endpoint.

Resource

Gets the resource owner of the endpoint reference.

Scheme

Gets the scheme for this endpoint.

TargetPort

Gets the target port for this endpoint. If the port is dynamically allocated, this will return null.

Url

Gets the URL for this endpoint.

Methods

GetValueAsync(CancellationToken)

Gets the URL of the endpoint asynchronously. Waits for the endpoint to be allocated if necessary.

GetValueAsync(ValueProviderContext, CancellationToken)

Gets the URL of the endpoint asynchronously. Waits for the endpoint to be allocated if necessary.

Property(EndpointProperty)

Gets the specified property expression of the endpoint. Defaults to the URL if no property is specified.

Explicit Interface Implementations

IManifestExpressionProvider.ValueExpression
IValueProvider.GetValueAsync(CancellationToken)
IValueWithReferences.References

Extension Methods

AsProvisioningParameter(EndpointReference, AzureResourceInfrastructure, String)

Creates a new ProvisioningParameter in infrastructure, or reuses an existing bicep parameter if one with the same name already exists, that corresponds to endpointReference.

AsProvisioningParameter(IManifestExpressionProvider, AzureResourceInfrastructure, String, Nullable<Boolean>)

Creates a new ProvisioningParameter in infrastructure, or reuses an existing bicep parameter if one with

AsEnvironmentPlaceholder(IManifestExpressionProvider, DockerComposeServiceResource)

Creates a placeholder for an environment variable in the Docker Compose file.

Applies to