AzureApiManagementResource

Handle
📦 Aspire.Hosting.Azure.ApiManagement v17.0.0-preview.1.26567.5
interface AzureApiManagementResource
extends IAzureResource,
IResource,
IResourceWithParameters,
IAzurePrivateEndpointTarget {
addApi(
name: string,
target: IComputeResource,
path: string,
displayName?: string,
subscriptionRequired?: boolean,
apiName?: string): AzureApiManagementApiResource;
addApiWithoutTarget(
name: string,
path: string,
displayName?: string,
subscriptionRequired?: boolean,
apiName?: string): AzureApiManagementApiResource;
addAzureOpenAIBackend(
name: string,
deployment: AzureOpenAIDeploymentResource,
backendName?: string): AzureApiManagementBackendResource;
addBackend(
name: string,
uri: ReferenceExpression,
options?: AzureApiManagementBackendOptions,
backendName?: string): AzureApiManagementBackendResource;
addBackendPool(
name: string,
displayName?: string,
backendPoolName?: string): AzureApiManagementBackendPoolResource;
addBlobStorageBackend(
name: string,
blobs: AzureBlobStorageResource,
backendName?: string): AzureApiManagementBackendResource;
addFoundryBackend(
name: string,
deployment: FoundryDeploymentResource,
backendName?: string): AzureApiManagementBackendResource;
addKeyVaultNamedValue(
name: string,
vault: AzureKeyVaultResource,
secretName: string,
displayName?: string,
namedValueName?: string,
tags?: string[]): AzureApiManagementNamedValueResource;
addNamedValue(
name: string,
value: string,
displayName?: string,
namedValueName?: string,
tags?: string[]): AzureApiManagementNamedValueResource;
addOpenAIApi(
name: string,
path: string,
displayName?: string,
subscriptionRequired?: boolean,
apiName?: string): AzureApiManagementApiResource;
addPolicyFragment(
name: string,
policyXml: string,
description?: string,
fragmentName?: string): AzureApiManagementPolicyFragmentResource;
addProduct(
name: string,
displayName: string,
options?: AzureApiManagementProductOptions,
productName?: string): AzureApiManagementProductResource;
addSecretNamedValue(
name: string,
value: ParameterResource,
displayName?: string,
namedValueName?: string,
tags?: string[]): AzureApiManagementNamedValueResource;
withApplicationInsights(
applicationInsights: AzureApplicationInsightsResource,
options?: AzureApiManagementDiagnosticOptions): AzureApiManagementResource;
withAzureUserAssignedIdentity(identityResourceBuilder: AzureUserAssignedIdentityResource): AzureApiManagementResource;
withClassicVirtualNetwork(
subnet: AzureSubnetResource,
mode: AzureApiManagementVirtualNetworkMode): AzureApiManagementResource;
withCustomDomain(
hostname: string,
vault: AzureKeyVaultResource,
certificateSecretName: string,
type?: AzureApiManagementHostnameType,
defaultSslBinding?: boolean,
negotiateClientCertificate?: boolean): AzureApiManagementResource;
withInboundPolicy(policyXml: string): AzureApiManagementResource;
withInboundPolicyFragment(fragment: AzureApiManagementPolicyFragmentResource): AzureApiManagementResource;
withPolicy(policyXml: string): AzureApiManagementResource;
withVirtualNetworkInjection(subnet: AzureSubnetResource): AzureApiManagementResource;
withVirtualNetworkIntegration(subnet: AzureSubnetResource): AzureApiManagementResource;
}

Methods

methodaddApibuilder
Adds an API that routes requests to an Aspire compute resource.
addApi(
name: string,
target: IComputeResource,
path: string,
displayName?: string,
subscriptionRequired?: boolean,
apiName?: string): 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.
displayNamestringoptionalThe API display name. The resource name is used when omitted.
subscriptionRequiredbooleanoptional= TrueWhether callers must provide an API Management subscription key. The default is `true`.
apiNamestringoptionalThe physical API identifier in API Management. The Aspire resource name is used when omitted.
AzureApiManagementApiResource
methodaddApiWithoutTargetbuilder
Adds an API whose backend is configured separately.
addApiWithoutTarget(
name: string,
path: string,
displayName?: string,
subscriptionRequired?: boolean,
apiName?: string): AzureApiManagementApiResource
namestringThe globally unique Aspire resource name and default physical API name.
pathstringThe public path beneath the API Management gateway hostname.
displayNamestringoptionalThe API display name. The resource name is used when omitted.
subscriptionRequiredbooleanoptional= TrueWhether callers must provide an API Management subscription key. The default is `true`.
apiNamestringoptionalThe physical API identifier in API Management. The Aspire resource name is used when omitted.
AzureApiManagementApiResource
Adds an Azure OpenAI deployment as an API Management backend.
addAzureOpenAIBackend(
name: string,
deployment: AzureOpenAIDeploymentResource,
backendName?: string): AzureApiManagementBackendResource
namestring
deploymentAzureOpenAIDeploymentResource
backendNamestringoptional
AzureApiManagementBackendResource
methodaddBackendbuilder
Adds a configurable backend to the API Management service.
addBackend(
name: string,
uri: ReferenceExpression,
options?: AzureApiManagementBackendOptions,
backendName?: string): AzureApiManagementBackendResource
namestringThe globally unique Aspire resource name and default physical backend name.
uriReferenceExpressionThe deferred URI of the backend service.
optionsAzureApiManagementBackendOptionsoptionalThe backend options.
backendNamestringoptionalThe physical backend identifier in API Management. The Aspire resource name is used when omitted.
AzureApiManagementBackendResource
methodaddBackendPoolbuilder
Adds a reusable load-balancing pool to the API Management service.
addBackendPool(
name: string,
displayName?: string,
backendPoolName?: string): AzureApiManagementBackendPoolResource
namestring
displayNamestringoptional
backendPoolNamestringoptional
AzureApiManagementBackendPoolResource
Adds an Azure Blob Storage service as an API Management backend.
addBlobStorageBackend(
name: string,
blobs: AzureBlobStorageResource,
backendName?: string): AzureApiManagementBackendResource
namestring
blobsAzureBlobStorageResource
backendNamestringoptional
AzureApiManagementBackendResource
methodaddFoundryBackendbuilder
Adds a Microsoft Foundry OpenAI deployment as an API Management backend.
addFoundryBackend(
name: string,
deployment: FoundryDeploymentResource,
backendName?: string): AzureApiManagementBackendResource
namestring
deploymentFoundryDeploymentResource
backendNamestringoptional
AzureApiManagementBackendResource
Adds a Key Vault-backed named value to the API Management service from a polyglot AppHost.
addKeyVaultNamedValue(
name: string,
vault: AzureKeyVaultResource,
secretName: string,
displayName?: string,
namedValueName?: string,
tags?: string[]): AzureApiManagementNamedValueResource
namestring
vaultAzureKeyVaultResource
secretNamestring
displayNamestringoptional
namedValueNamestringoptional
tagsstring[]optional
AzureApiManagementNamedValueResource
methodaddNamedValuebuilder
Adds a non-secret named value to the API Management service.
addNamedValue(
name: string,
value: string,
displayName?: string,
namedValueName?: string,
tags?: string[]): AzureApiManagementNamedValueResource
namestringThe globally unique Aspire resource name and default physical named-value name.
valuestringThe named value.
displayNamestringoptionalThe name used to reference the value in policies. The resource name is used when omitted.
namedValueNamestringoptionalThe physical named-value identifier in API Management. The resource name is used when omitted.
tagsstring[]optionalTags used to organize the named value.
AzureApiManagementNamedValueResource
methodaddOpenAIApibuilder
Adds an OpenAI-compatible API backed by an API Management load-balancing pool.
addOpenAIApi(
name: string,
path: string,
displayName?: string,
subscriptionRequired?: boolean,
apiName?: string): AzureApiManagementApiResource
namestringThe globally unique Aspire resource name and default physical API name.
pathstringThe public path beneath the API Management gateway hostname.
displayNamestringoptionalThe API display name. The resource name is used when omitted.
subscriptionRequiredbooleanoptional= TrueWhether callers must provide an API Management subscription key. The default is `true`.
apiNamestringoptionalThe physical API identifier in API Management. The Aspire resource name is used when omitted.
AzureApiManagementApiResource
methodaddPolicyFragmentbuilder
Adds a reusable policy fragment to the API Management service.
addPolicyFragment(
name: string,
policyXml: string,
description?: string,
fragmentName?: string): 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.
descriptionstringoptionalAn optional description.
fragmentNamestringoptionalThe physical policy-fragment identifier in API Management. The resource name is used when omitted.
AzureApiManagementPolicyFragmentResource
methodaddProductbuilder
Adds a product to the API Management service.
addProduct(
name: string,
displayName: string,
options?: AzureApiManagementProductOptions,
productName?: string): AzureApiManagementProductResource
namestringThe globally unique Aspire resource name and default physical product name.
displayNamestringThe product display name.
optionsAzureApiManagementProductOptionsoptionalThe product options.
productNamestringoptionalThe physical product identifier in API Management. The resource name is used when omitted.
AzureApiManagementProductResource
methodaddSecretNamedValuebuilder
Adds a secret parameter as a named value in the API Management service.
addSecretNamedValue(
name: string,
value: ParameterResource,
displayName?: string,
namedValueName?: string,
tags?: string[]): AzureApiManagementNamedValueResource
namestringThe globally unique Aspire resource name and default physical named-value name.
valueParameterResourceThe secret parameter containing the named value.
displayNamestringoptionalThe name used to reference the value in policies. The resource name is used when omitted.
namedValueNamestringoptionalThe physical named-value identifier in API Management. The resource name is used when omitted.
tagsstring[]optionalTags used to organize the named value.
AzureApiManagementNamedValueResource
Sends service-level API Management diagnostics to Application Insights.
withApplicationInsights(
applicationInsights: AzureApplicationInsightsResource,
options?: AzureApiManagementDiagnosticOptions): AzureApiManagementResource
applicationInsightsAzureApplicationInsightsResourceThe Application Insights resource.
optionsAzureApiManagementDiagnosticOptionsoptionalThe diagnostic options.
AzureApiManagementResource
Configures the user-assigned managed identity used by API Management.
withAzureUserAssignedIdentity(identityResourceBuilder: AzureUserAssignedIdentityResource): AzureApiManagementResource
identityResourceBuilderAzureUserAssignedIdentityResourceThe user-assigned managed identity.
AzureApiManagementResource
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
methodwithCustomDomainbuilder
Configures a custom hostname from a polyglot AppHost using a certificate stored in Azure Key Vault.
withCustomDomain(
hostname: string,
vault: AzureKeyVaultResource,
certificateSecretName: string,
type?: AzureApiManagementHostnameType,
defaultSslBinding?: boolean,
negotiateClientCertificate?: boolean): AzureApiManagementResource
hostnamestring
vaultAzureKeyVaultResource
certificateSecretNamestring
typeAzureApiManagementHostnameTypeoptional= Proxy
defaultSslBindingbooleanoptional= False
negotiateClientCertificatebooleanoptional= False
AzureApiManagementResource
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
Includes a policy fragment in the service-level inbound policy.
withInboundPolicyFragment(fragment: AzureApiManagementPolicyFragmentResource): AzureApiManagementResource
fragmentAzureApiManagementPolicyFragmentResourceThe policy fragment to include.
AzureApiManagementResource
methodwithPolicybuilder
Replaces the complete service-level policy document.
withPolicy(policyXml: string): AzureApiManagementResource
policyXmlstringA complete APIM `policies` XML document.
AzureApiManagementResource
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
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