ResourceBuilderExtensions.WithHttpEndpoint<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Exposes an HTTP endpoint on a resource. This endpoint reference can be retrieved using GetEndpoint<T>(IResourceBuilder<T>, String). The endpoint name will be "http" if not specified.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithHttpEndpoint<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, int? port = default, int? targetPort = default, string? name = default, string? env = default, bool isProxied = true) where T : Aspire.Hosting.ApplicationModel.IResourceWithEndpoints;
static member WithHttpEndpoint : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithEndpoints)> * Nullable<int> * Nullable<int> * string * string * bool -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithEndpoints)> (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithEndpoints)
<Extension()>
Public Function WithHttpEndpoint(Of T As IResourceWithEndpoints) (builder As IResourceBuilder(Of T), Optional port As Nullable(Of Integer) = Nothing, Optional targetPort As Nullable(Of Integer) = Nothing, Optional name As String = Nothing, Optional env As String = Nothing, Optional isProxied As Boolean = true) As IResourceBuilder(Of T)
Type Parameters
- T
The resource type.
Parameters
- builder
- IResourceBuilder<T>
The resource builder.
An optional port. This is the port that will be given to other resource to communicate with this resource.
This is the port the resource is listening on. If the endpoint is used for the container, it is the container port.
- name
- String
An optional name of the endpoint. Defaults to "http" if not specified.
- env
- String
An optional name of the environment variable to inject.
- isProxied
- Boolean
Specifies if the endpoint will be proxied by DCP. Defaults to true.
Returns
The IResourceBuilder<T>.
Exceptions
Throws an exception if an endpoint with the same name already exists on the specified resource.