AzureApiManagementResource

Handle
📦 Aspire.Hosting.Azure.ApiManagement v17.0.0-preview.1.26567.5

Represents an Azure API Management service.

type AzureApiManagementResource interface {
Resource
}

Methods

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

methodAddApiWithoutTargetbuilder
Adds an API whose backend is configured separately.
AddApiWithoutTarget(
name string,
path string,
options ...*AddApiWithoutTargetOptions,
) AzureApiManagementApiResource
namestringThe globally unique Aspire resource name and default physical API name.
pathstringThe public path beneath the API Management gateway hostname.
options...*AddApiWithoutTargetOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddApiWithoutTargetOptions 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().

Adds an Azure OpenAI deployment as an API Management backend.
AddAzureOpenAIBackend(
name string,
deployment AzureOpenAIDeploymentResource,
options ...*AddAzureOpenAIBackendOptions,
) AzureApiManagementBackendResource
namestring
deploymentAzureOpenAIDeploymentResource
options...*AddAzureOpenAIBackendOptionsOptional settings, described under Options.

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

BackendName*string
AzureApiManagementBackendResource

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

methodAddBackendbuilder
Adds a configurable backend to the API Management service.
AddBackend(
name string,
uri *ReferenceExpression,
options ...*AddBackendOptions,
) AzureApiManagementBackendResource
namestringThe globally unique Aspire resource name and default physical backend name.
uri*ReferenceExpressionThe deferred URI of the backend service.
options...*AddBackendOptionsOptional settings, described under Options.

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

Options*AzureApiManagementBackendOptionsThe backend options.
BackendName*stringThe physical backend identifier in API Management. The Aspire resource name is used when omitted.
AzureApiManagementBackendResource

A builder for the backend resource.

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

methodAddBackendPoolbuilder
Adds a reusable load-balancing pool to the API Management service.
AddBackendPool(
name string,
options ...*AddBackendPoolOptions,
) AzureApiManagementBackendPoolResource
namestring
options...*AddBackendPoolOptionsOptional settings, described under Options.

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

DisplayName*string
BackendPoolName*string
AzureApiManagementBackendPoolResource

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

Adds an Azure Blob Storage service as an API Management backend.
AddBlobStorageBackend(
name string,
blobs AzureBlobStorageResource,
options ...*AddBlobStorageBackendOptions,
) AzureApiManagementBackendResource
namestring
blobsAzureBlobStorageResource
options...*AddBlobStorageBackendOptionsOptional settings, described under Options.

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

BackendName*string
AzureApiManagementBackendResource

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

methodAddFoundryBackendbuilder
Adds a Microsoft Foundry OpenAI deployment as an API Management backend.
AddFoundryBackend(
name string,
deployment FoundryDeploymentResource,
options ...*AddFoundryBackendOptions,
) AzureApiManagementBackendResource
namestring
deploymentFoundryDeploymentResource
options...*AddFoundryBackendOptionsOptional settings, described under Options.

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

BackendName*string
AzureApiManagementBackendResource

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

Adds a Key Vault-backed named value to the API Management service from a polyglot AppHost.
AddKeyVaultNamedValue(
name string,
vault AzureKeyVaultResource,
secretName string,
options ...*AddKeyVaultNamedValueOptions,
) AzureApiManagementNamedValueResource
namestring
vaultAzureKeyVaultResource
secretNamestring
options...*AddKeyVaultNamedValueOptionsOptional settings, described under Options.

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

DisplayName*string
NamedValueName*string
Tags[]string
AzureApiManagementNamedValueResource

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

methodAddNamedValuebuilder
Adds a non-secret named value to the API Management service.
AddNamedValue(
name string,
value string,
options ...*AddNamedValueOptions,
) AzureApiManagementNamedValueResource
namestringThe globally unique Aspire resource name and default physical named-value name.
valuestringThe named value.
options...*AddNamedValueOptionsOptional settings, described under Options.

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

DisplayName*stringThe name used to reference the value in policies. The resource name is used when omitted.
NamedValueName*stringThe physical named-value identifier in API Management. The resource name is used when omitted.
Tags[]stringTags used to organize the named value.
AzureApiManagementNamedValueResource

A builder for the named-value resource.

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

methodAddOpenAIApibuilder
Adds an OpenAI-compatible API backed by an API Management load-balancing pool.
AddOpenAIApi(
name string,
path string,
options ...*AddOpenAIApiOptions,
) AzureApiManagementApiResource
namestringThe globally unique Aspire resource name and default physical API name.
pathstringThe public path beneath the API Management gateway hostname.
options...*AddOpenAIApiOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddOpenAIApiOptions 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().

methodAddPolicyFragmentbuilder
Adds a reusable policy fragment to the API Management service.
AddPolicyFragment(
name string,
policyXml string,
options ...*AddPolicyFragmentOptions,
) AzureApiManagementPolicyFragmentResource
namestringThe globally unique Aspire resource name and default physical policy-fragment name.
policyXmlstringOne or more well-formed APIM policy elements without a fragment envelope.
options...*AddPolicyFragmentOptionsOptional settings, described under Options.

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

Description*stringAn optional description.
FragmentName*stringThe physical policy-fragment identifier in API Management. The resource name is used when omitted.
AzureApiManagementPolicyFragmentResource

A builder for the policy-fragment resource.

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

methodAddProductbuilder
Adds a product to the API Management service.
AddProduct(
name string,
displayName string,
options ...*AddProductOptions,
) AzureApiManagementProductResource
namestringThe globally unique Aspire resource name and default physical product name.
displayNamestringThe product display name.
options...*AddProductOptionsOptional settings, described under Options.

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

Options*AzureApiManagementProductOptionsThe product options.
ProductName*stringThe physical product identifier in API Management. The resource name is used when omitted.
AzureApiManagementProductResource

A builder for the product resource.

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

methodAddSecretNamedValuebuilder
Adds a secret parameter as a named value in the API Management service.
AddSecretNamedValue(
name string,
value ParameterResource,
options ...*AddSecretNamedValueOptions,
) AzureApiManagementNamedValueResource
namestringThe globally unique Aspire resource name and default physical named-value name.
valueParameterResourceThe secret parameter containing the named value.
options...*AddSecretNamedValueOptionsOptional settings, described under Options.

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

DisplayName*stringThe name used to reference the value in policies. The resource name is used when omitted.
NamedValueName*stringThe physical named-value identifier in API Management. The resource name is used when omitted.
Tags[]stringTags used to organize the named value.
AzureApiManagementNamedValueResource

A builder for the named-value resource.

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

Sends service-level API Management diagnostics to Application Insights.
WithApplicationInsights(
applicationInsights AzureApplicationInsightsResource,
options ...*AzureApiManagementDiagnosticOptions,
) AzureApiManagementResource
applicationInsightsAzureApplicationInsightsResourceThe Application Insights resource.
options...*AzureApiManagementDiagnosticOptionsOptional settings, described under Options.

Optional parameters are passed as the existing *AzureApiManagementDiagnosticOptions struct.

AzureApiManagementResource

The resource builder.

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

Configures the user-assigned managed identity used by API Management.
WithAzureUserAssignedIdentity(identityResourceBuilder AzureUserAssignedIdentityResource) AzureApiManagementResource
identityResourceBuilderAzureUserAssignedIdentityResourceThe user-assigned managed identity.
AzureApiManagementResource

The Azure API Management resource builder.

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

Injects a classic Developer or Premium API Management service into a virtual network subnet.
WithClassicVirtualNetwork(
subnet AzureSubnetResource,
mode AzureApiManagementVirtualNetworkMode,
) AzureApiManagementResource
subnetAzureSubnetResourceThe subnet resource. Classic APIM injection requires an undelegated subnet with an NSG.
modeAzureApiManagementVirtualNetworkModeWhether the APIM endpoints are externally or internally accessible.
AzureApiManagementResource

The resource builder.

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

methodWithCustomDomainbuilder
Configures a custom hostname from a polyglot AppHost using a certificate stored in Azure Key Vault.
WithCustomDomain(
hostname string,
vault AzureKeyVaultResource,
certificateSecretName string,
options ...*WithCustomDomainOptions,
) AzureApiManagementResource
hostnamestring
vaultAzureKeyVaultResource
certificateSecretNamestring
options...*WithCustomDomainOptionsOptional settings, described under Options.

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

Type*AzureApiManagementHostnameType
DefaultSslBinding*bool
NegotiateClientCertificate*bool
AzureApiManagementResource

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

methodWithInboundPolicybuilder
Appends an XML policy statement to the service-level inbound policy section.
WithInboundPolicy(policyXml string) AzureApiManagementResource
policyXmlstringOne or more well-formed APIM policy elements without a policies envelope.
AzureApiManagementResource

The resource builder.

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

Includes a policy fragment in the service-level inbound policy.
WithInboundPolicyFragment(fragment AzureApiManagementPolicyFragmentResource) AzureApiManagementResource
fragmentAzureApiManagementPolicyFragmentResourceThe policy fragment to include.
AzureApiManagementResource

The resource builder.

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

methodWithPolicybuilder
Replaces the complete service-level policy document.
WithPolicy(policyXml string) AzureApiManagementResource
policyXmlstringA complete APIM policies XML document.
AzureApiManagementResource

The resource builder.

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

Injects a Premium v2 API Management service into a virtual network for private inbound and outbound access.
WithVirtualNetworkInjection(subnet AzureSubnetResource) AzureApiManagementResource
subnetAzureSubnetResourceA dedicated subnet for API Management virtual network injection.
AzureApiManagementResource

The resource builder.

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

Integrates a Standard v2 or Premium v2 API Management service with a virtual network for outbound access.
WithVirtualNetworkIntegration(subnet AzureSubnetResource) AzureApiManagementResource
subnetAzureSubnetResourceA dedicated subnet for API Management virtual network integration.
AzureApiManagementResource

The resource builder.

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