We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.apimanagement.getApi
Explore with Pulumi AI
Use this data source to access information about an existing API Management API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.apimanagement.getApi({
    name: "search-api",
    apiManagementName: "search-api-management",
    resourceGroupName: "search-service",
    revision: "2",
});
export const apiManagementApiId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.apimanagement.get_api(name="search-api",
    api_management_name="search-api-management",
    resource_group_name="search-service",
    revision="2")
pulumi.export("apiManagementApiId", example.id)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{
			Name:              "search-api",
			ApiManagementName: "search-api-management",
			ResourceGroupName: "search-service",
			Revision:          "2",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("apiManagementApiId", example.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.ApiManagement.GetApi.Invoke(new()
    {
        Name = "search-api",
        ApiManagementName = "search-api-management",
        ResourceGroupName = "search-service",
        Revision = "2",
    });
    return new Dictionary<string, object?>
    {
        ["apiManagementApiId"] = example.Apply(getApiResult => getApiResult.Id),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.apimanagement.ApimanagementFunctions;
import com.pulumi.azure.apimanagement.inputs.GetApiArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var example = ApimanagementFunctions.getApi(GetApiArgs.builder()
            .name("search-api")
            .apiManagementName("search-api-management")
            .resourceGroupName("search-service")
            .revision("2")
            .build());
        ctx.export("apiManagementApiId", example.applyValue(getApiResult -> getApiResult.id()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:apimanagement:getApi
      arguments:
        name: search-api
        apiManagementName: search-api-management
        resourceGroupName: search-service
        revision: '2'
outputs:
  apiManagementApiId: ${example.id}
Using getApi
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getApi(args: GetApiArgs, opts?: InvokeOptions): Promise<GetApiResult>
function getApiOutput(args: GetApiOutputArgs, opts?: InvokeOptions): Output<GetApiResult>def get_api(api_management_name: Optional[str] = None,
            name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            revision: Optional[str] = None,
            opts: Optional[InvokeOptions] = None) -> GetApiResult
def get_api_output(api_management_name: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            resource_group_name: Optional[pulumi.Input[str]] = None,
            revision: Optional[pulumi.Input[str]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetApiResult]func LookupApi(ctx *Context, args *LookupApiArgs, opts ...InvokeOption) (*LookupApiResult, error)
func LookupApiOutput(ctx *Context, args *LookupApiOutputArgs, opts ...InvokeOption) LookupApiResultOutput> Note: This function is named LookupApi in the Go SDK.
public static class GetApi 
{
    public static Task<GetApiResult> InvokeAsync(GetApiArgs args, InvokeOptions? opts = null)
    public static Output<GetApiResult> Invoke(GetApiInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetApiResult> getApi(GetApiArgs args, InvokeOptions options)
public static Output<GetApiResult> getApi(GetApiArgs args, InvokeOptions options)
fn::invoke:
  function: azure:apimanagement/getApi:getApi
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ApiManagement stringName 
- The name of the API Management Service in which the API Management API exists.
- Name string
- The name of the API Management API.
- ResourceGroup stringName 
- The Name of the Resource Group in which the API Management Service exists.
- Revision string
- The Revision of the API Management API.
- ApiManagement stringName 
- The name of the API Management Service in which the API Management API exists.
- Name string
- The name of the API Management API.
- ResourceGroup stringName 
- The Name of the Resource Group in which the API Management Service exists.
- Revision string
- The Revision of the API Management API.
- apiManagement StringName 
- The name of the API Management Service in which the API Management API exists.
- name String
- The name of the API Management API.
- resourceGroup StringName 
- The Name of the Resource Group in which the API Management Service exists.
- revision String
- The Revision of the API Management API.
- apiManagement stringName 
- The name of the API Management Service in which the API Management API exists.
- name string
- The name of the API Management API.
- resourceGroup stringName 
- The Name of the Resource Group in which the API Management Service exists.
- revision string
- The Revision of the API Management API.
- api_management_ strname 
- The name of the API Management Service in which the API Management API exists.
- name str
- The name of the API Management API.
- resource_group_ strname 
- The Name of the Resource Group in which the API Management Service exists.
- revision str
- The Revision of the API Management API.
- apiManagement StringName 
- The name of the API Management Service in which the API Management API exists.
- name String
- The name of the API Management API.
- resourceGroup StringName 
- The Name of the Resource Group in which the API Management Service exists.
- revision String
- The Revision of the API Management API.
getApi Result
The following output properties are available:
- ApiManagement stringName 
- Description string
- A description of the API Management API, which may include HTML formatting tags.
- DisplayName string
- The display name of the API.
- Id string
- The provider-assigned unique ID for this managed resource.
- IsCurrent bool
- Is this the current API Revision?
- IsOnline bool
- Is this API Revision online/accessible via the Gateway?
- Name string
- Path string
- The Path for this API Management API.
- Protocols List<string>
- A list of protocols the operations in this API can be invoked.
- ResourceGroup stringName 
- Revision string
- ServiceUrl string
- Absolute URL of the backend service implementing this API.
- SoapPass boolThrough 
- Should this API expose a SOAP frontend, rather than a HTTP frontend?
- SubscriptionKey List<GetParameter Names Api Subscription Key Parameter Name> 
- A subscription_key_parameter_namesblock as documented below.
- SubscriptionRequired bool
- Should this API require a subscription key?
- Version string
- The Version number of this API, if this API is versioned.
- VersionSet stringId 
- The ID of the Version Set which this API is associated with.
- ApiManagement stringName 
- Description string
- A description of the API Management API, which may include HTML formatting tags.
- DisplayName string
- The display name of the API.
- Id string
- The provider-assigned unique ID for this managed resource.
- IsCurrent bool
- Is this the current API Revision?
- IsOnline bool
- Is this API Revision online/accessible via the Gateway?
- Name string
- Path string
- The Path for this API Management API.
- Protocols []string
- A list of protocols the operations in this API can be invoked.
- ResourceGroup stringName 
- Revision string
- ServiceUrl string
- Absolute URL of the backend service implementing this API.
- SoapPass boolThrough 
- Should this API expose a SOAP frontend, rather than a HTTP frontend?
- SubscriptionKey []GetParameter Names Api Subscription Key Parameter Name 
- A subscription_key_parameter_namesblock as documented below.
- SubscriptionRequired bool
- Should this API require a subscription key?
- Version string
- The Version number of this API, if this API is versioned.
- VersionSet stringId 
- The ID of the Version Set which this API is associated with.
- apiManagement StringName 
- description String
- A description of the API Management API, which may include HTML formatting tags.
- displayName String
- The display name of the API.
- id String
- The provider-assigned unique ID for this managed resource.
- isCurrent Boolean
- Is this the current API Revision?
- isOnline Boolean
- Is this API Revision online/accessible via the Gateway?
- name String
- path String
- The Path for this API Management API.
- protocols List<String>
- A list of protocols the operations in this API can be invoked.
- resourceGroup StringName 
- revision String
- serviceUrl String
- Absolute URL of the backend service implementing this API.
- soapPass BooleanThrough 
- Should this API expose a SOAP frontend, rather than a HTTP frontend?
- subscriptionKey List<GetParameter Names Api Subscription Key Parameter Name> 
- A subscription_key_parameter_namesblock as documented below.
- subscriptionRequired Boolean
- Should this API require a subscription key?
- version String
- The Version number of this API, if this API is versioned.
- versionSet StringId 
- The ID of the Version Set which this API is associated with.
- apiManagement stringName 
- description string
- A description of the API Management API, which may include HTML formatting tags.
- displayName string
- The display name of the API.
- id string
- The provider-assigned unique ID for this managed resource.
- isCurrent boolean
- Is this the current API Revision?
- isOnline boolean
- Is this API Revision online/accessible via the Gateway?
- name string
- path string
- The Path for this API Management API.
- protocols string[]
- A list of protocols the operations in this API can be invoked.
- resourceGroup stringName 
- revision string
- serviceUrl string
- Absolute URL of the backend service implementing this API.
- soapPass booleanThrough 
- Should this API expose a SOAP frontend, rather than a HTTP frontend?
- subscriptionKey GetParameter Names Api Subscription Key Parameter Name[] 
- A subscription_key_parameter_namesblock as documented below.
- subscriptionRequired boolean
- Should this API require a subscription key?
- version string
- The Version number of this API, if this API is versioned.
- versionSet stringId 
- The ID of the Version Set which this API is associated with.
- api_management_ strname 
- description str
- A description of the API Management API, which may include HTML formatting tags.
- display_name str
- The display name of the API.
- id str
- The provider-assigned unique ID for this managed resource.
- is_current bool
- Is this the current API Revision?
- is_online bool
- Is this API Revision online/accessible via the Gateway?
- name str
- path str
- The Path for this API Management API.
- protocols Sequence[str]
- A list of protocols the operations in this API can be invoked.
- resource_group_ strname 
- revision str
- service_url str
- Absolute URL of the backend service implementing this API.
- soap_pass_ boolthrough 
- Should this API expose a SOAP frontend, rather than a HTTP frontend?
- subscription_key_ Sequence[Getparameter_ names Api Subscription Key Parameter Name] 
- A subscription_key_parameter_namesblock as documented below.
- subscription_required bool
- Should this API require a subscription key?
- version str
- The Version number of this API, if this API is versioned.
- version_set_ strid 
- The ID of the Version Set which this API is associated with.
- apiManagement StringName 
- description String
- A description of the API Management API, which may include HTML formatting tags.
- displayName String
- The display name of the API.
- id String
- The provider-assigned unique ID for this managed resource.
- isCurrent Boolean
- Is this the current API Revision?
- isOnline Boolean
- Is this API Revision online/accessible via the Gateway?
- name String
- path String
- The Path for this API Management API.
- protocols List<String>
- A list of protocols the operations in this API can be invoked.
- resourceGroup StringName 
- revision String
- serviceUrl String
- Absolute URL of the backend service implementing this API.
- soapPass BooleanThrough 
- Should this API expose a SOAP frontend, rather than a HTTP frontend?
- subscriptionKey List<Property Map>Parameter Names 
- A subscription_key_parameter_namesblock as documented below.
- subscriptionRequired Boolean
- Should this API require a subscription key?
- version String
- The Version number of this API, if this API is versioned.
- versionSet StringId 
- The ID of the Version Set which this API is associated with.
Supporting Types
GetApiSubscriptionKeyParameterName     
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.