# AzureApiManagementResource

- Module: [Aspire.Hosting.Azure.ApiManagement](/reference/api/go/aspire.hosting.azure.apimanagement.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Represents an Azure API Management service.

## Remarks

API Management is provisioned in Azure and acts as a gateway for APIs added with
`AddApi`.

## Definition

```go
type AzureApiManagementResource interface {
    Resource
}
```

## Embeds

- `Resource`

## Methods

- [AddApi](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addapi.md) -- `method` -- Adds an API that routes requests to an Aspire compute resource.
  ```go
  AddApi(name string, target IComputeResource, path string, options ...*AddApiOptions) AzureApiManagementApiResource
  ```
- [AddApiWithoutTarget](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addapiwithouttarget.md) -- `method` -- Adds an API whose backend is configured separately.
  ```go
  AddApiWithoutTarget(name string, path string, options ...*AddApiWithoutTargetOptions) AzureApiManagementApiResource
  ```
- [AddAzureOpenAIBackend](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addazureopenaibackend.md) -- `method` -- Adds an Azure OpenAI deployment as an API Management backend.
  ```go
  AddAzureOpenAIBackend(name string, deployment AzureOpenAIDeploymentResource, options ...*AddAzureOpenAIBackendOptions) AzureApiManagementBackendResource
  ```
- [AddBackend](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addbackend.md) -- `method` -- Adds a configurable backend to the API Management service.
  ```go
  AddBackend(name string, uri *ReferenceExpression, options ...*AddBackendOptions) AzureApiManagementBackendResource
  ```
- [AddBackendPool](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addbackendpool.md) -- `method` -- Adds a reusable load-balancing pool to the API Management service.
  ```go
  AddBackendPool(name string, options ...*AddBackendPoolOptions) AzureApiManagementBackendPoolResource
  ```
- [AddBlobStorageBackend](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addblobstoragebackend.md) -- `method` -- Adds an Azure Blob Storage service as an API Management backend.
  ```go
  AddBlobStorageBackend(name string, blobs AzureBlobStorageResource, options ...*AddBlobStorageBackendOptions) AzureApiManagementBackendResource
  ```
- [AddFoundryBackend](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addfoundrybackend.md) -- `method` -- Adds a Microsoft Foundry OpenAI deployment as an API Management backend.
  ```go
  AddFoundryBackend(name string, deployment FoundryDeploymentResource, options ...*AddFoundryBackendOptions) AzureApiManagementBackendResource
  ```
- [AddKeyVaultNamedValue](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addkeyvaultnamedvalue.md) -- `method` -- Adds a Key Vault-backed named value to the API Management service from a polyglot AppHost.
  ```go
  AddKeyVaultNamedValue(name string, vault AzureKeyVaultResource, secretName string, options ...*AddKeyVaultNamedValueOptions) AzureApiManagementNamedValueResource
  ```
- [AddNamedValue](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addnamedvalue.md) -- `method` -- Adds a non-secret named value to the API Management service.
  ```go
  AddNamedValue(name string, value string, options ...*AddNamedValueOptions) AzureApiManagementNamedValueResource
  ```
- [AddOpenAIApi](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addopenaiapi.md) -- `method` -- Adds an OpenAI-compatible API backed by an API Management load-balancing pool.
  ```go
  AddOpenAIApi(name string, path string, options ...*AddOpenAIApiOptions) AzureApiManagementApiResource
  ```
- [AddPolicyFragment](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addpolicyfragment.md) -- `method` -- Adds a reusable policy fragment to the API Management service.
  ```go
  AddPolicyFragment(name string, policyXml string, options ...*AddPolicyFragmentOptions) AzureApiManagementPolicyFragmentResource
  ```
- [AddProduct](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addproduct.md) -- `method` -- Adds a product to the API Management service.
  ```go
  AddProduct(name string, displayName string, options ...*AddProductOptions) AzureApiManagementProductResource
  ```
- [AddSecretNamedValue](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/addsecretnamedvalue.md) -- `method` -- Adds a secret parameter as a named value in the API Management service.
  ```go
  AddSecretNamedValue(name string, value ParameterResource, options ...*AddSecretNamedValueOptions) AzureApiManagementNamedValueResource
  ```
- [WithApplicationInsights](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/withapplicationinsights.md) -- `method` -- Sends service-level API Management diagnostics to Application Insights.
  ```go
  WithApplicationInsights(applicationInsights AzureApplicationInsightsResource, options ...*AzureApiManagementDiagnosticOptions) AzureApiManagementResource
  ```
- [WithAzureUserAssignedIdentity](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/withazureuserassignedidentity.md) -- `method` -- Configures the user-assigned managed identity used by API Management.
  ```go
  WithAzureUserAssignedIdentity(identityResourceBuilder AzureUserAssignedIdentityResource) AzureApiManagementResource
  ```
- [WithClassicVirtualNetwork](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/withclassicvirtualnetwork.md) -- `method` -- Injects a classic Developer or Premium API Management service into a virtual network subnet.
  ```go
  WithClassicVirtualNetwork(subnet AzureSubnetResource, mode AzureApiManagementVirtualNetworkMode) AzureApiManagementResource
  ```
- [WithCustomDomain](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/withcustomdomain.md) -- `method` -- Configures a custom hostname from a polyglot AppHost using a certificate stored in Azure Key Vault.
  ```go
  WithCustomDomain(hostname string, vault AzureKeyVaultResource, certificateSecretName string, options ...*WithCustomDomainOptions) AzureApiManagementResource
  ```
- [WithInboundPolicy](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/withinboundpolicy.md) -- `method` -- Appends an XML policy statement to the service-level inbound policy section.
  ```go
  WithInboundPolicy(policyXml string) AzureApiManagementResource
  ```
- [WithInboundPolicyFragment](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/withinboundpolicyfragment.md) -- `method` -- Includes a policy fragment in the service-level inbound policy.
  ```go
  WithInboundPolicyFragment(fragment AzureApiManagementPolicyFragmentResource) AzureApiManagementResource
  ```
- [WithPolicy](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/withpolicy.md) -- `method` -- Replaces the complete service-level policy document.
  ```go
  WithPolicy(policyXml string) AzureApiManagementResource
  ```
- [WithVirtualNetworkInjection](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/withvirtualnetworkinjection.md) -- `method` -- Injects a Premium v2 API Management service into a virtual network for private inbound and outbound access.
  ```go
  WithVirtualNetworkInjection(subnet AzureSubnetResource) AzureApiManagementResource
  ```
- [WithVirtualNetworkIntegration](/reference/api/go/aspire.hosting.azure.apimanagement/azureapimanagementresource/withvirtualnetworkintegration.md) -- `method` -- Integrates a Standard v2 or Premium v2 API Management service with a virtual network for outbound access.
  ```go
  WithVirtualNetworkIntegration(subnet AzureSubnetResource) AzureApiManagementResource
  ```
