AddApi

Method
📦 Aspire.Hosting.Azure.ApiManagement v17.0.0-preview.1.26567.5
func (AzureApiManagementResource) AddApi(
name string,
target IComputeResource,
path string,
options ...*AddApiOptions,
) AzureApiManagementApiResource

Signature

methodAddApibuilder
Adds an API that routes requests to an Aspire compute resource.
AddApi(
name string,
target IComputeResource,
path string,
options ...*AddApiOptions,
) AzureApiManagementApiResource
namestringThe globally unique Aspire resource name and default physical API name.
targetIComputeResourceThe backend compute resource. It must expose an HTTP or HTTPS endpoint. Internal endpoints require the API Management service to have virtual network connectivity to the target.
pathstringThe public path beneath the API Management gateway hostname.
options...*AddApiOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddApiOptions argument.

DisplayName*stringThe API display name. The resource name is used when omitted.
SubscriptionRequired*boolWhether callers must provide an API Management subscription key. The default is true.
ApiName*stringThe physical API identifier in API Management. The Aspire resource name is used when omitted.
AzureApiManagementApiResource

A builder for the API resource.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: