We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.apimanagement.getSubscription
Start a Neo task
Explain and create an azure.apimanagement.getSubscription resource
Use this data source to access information about an existing API Management Subscription.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.apimanagement.getSubscription({
apiManagementId: "example-apim",
subscriptionId: "example-subscription-id",
});
export const id = example.then(example => example.subscriptionId);
import pulumi
import pulumi_azure as azure
example = azure.apimanagement.get_subscription(api_management_id="example-apim",
subscription_id="example-subscription-id")
pulumi.export("id", example.subscription_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.LookupSubscription(ctx, &apimanagement.LookupSubscriptionArgs{
ApiManagementId: "example-apim",
SubscriptionId: "example-subscription-id",
}, nil)
if err != nil {
return err
}
ctx.Export("id", example.SubscriptionId)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.ApiManagement.GetSubscription.Invoke(new()
{
ApiManagementId = "example-apim",
SubscriptionId = "example-subscription-id",
});
return new Dictionary<string, object?>
{
["id"] = example.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId),
};
});
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.GetSubscriptionArgs;
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.getSubscription(GetSubscriptionArgs.builder()
.apiManagementId("example-apim")
.subscriptionId("example-subscription-id")
.build());
ctx.export("id", example.subscriptionId());
}
}
variables:
example:
fn::invoke:
function: azure:apimanagement:getSubscription
arguments:
apiManagementId: example-apim
subscriptionId: example-subscription-id
outputs:
id: ${example.subscriptionId}
API Providers
This data source uses the following Azure API Providers:
Microsoft.ApiManagement- 2022-08-01
Using getSubscription
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 getSubscription(args: GetSubscriptionArgs, opts?: InvokeOptions): Promise<GetSubscriptionResult>
function getSubscriptionOutput(args: GetSubscriptionOutputArgs, opts?: InvokeOptions): Output<GetSubscriptionResult>def get_subscription(api_management_id: Optional[str] = None,
subscription_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSubscriptionResult
def get_subscription_output(api_management_id: Optional[pulumi.Input[str]] = None,
subscription_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSubscriptionResult]func LookupSubscription(ctx *Context, args *LookupSubscriptionArgs, opts ...InvokeOption) (*LookupSubscriptionResult, error)
func LookupSubscriptionOutput(ctx *Context, args *LookupSubscriptionOutputArgs, opts ...InvokeOption) LookupSubscriptionResultOutput> Note: This function is named LookupSubscription in the Go SDK.
public static class GetSubscription
{
public static Task<GetSubscriptionResult> InvokeAsync(GetSubscriptionArgs args, InvokeOptions? opts = null)
public static Output<GetSubscriptionResult> Invoke(GetSubscriptionInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSubscriptionResult> getSubscription(GetSubscriptionArgs args, InvokeOptions options)
public static Output<GetSubscriptionResult> getSubscription(GetSubscriptionArgs args, InvokeOptions options)
fn::invoke:
function: azure:apimanagement/getSubscription:getSubscription
arguments:
# arguments dictionaryThe following arguments are supported:
- Api
Management stringId - The ID of the API Management Service in which this Subscription exists.
- Subscription
Id string - The Identifier for the API Management Subscription.
- Api
Management stringId - The ID of the API Management Service in which this Subscription exists.
- Subscription
Id string - The Identifier for the API Management Subscription.
- api
Management StringId - The ID of the API Management Service in which this Subscription exists.
- subscription
Id String - The Identifier for the API Management Subscription.
- api
Management stringId - The ID of the API Management Service in which this Subscription exists.
- subscription
Id string - The Identifier for the API Management Subscription.
- api_
management_ strid - The ID of the API Management Service in which this Subscription exists.
- subscription_
id str - The Identifier for the API Management Subscription.
- api
Management StringId - The ID of the API Management Service in which this Subscription exists.
- subscription
Id String - The Identifier for the API Management Subscription.
getSubscription Result
The following output properties are available:
- Allow
Tracing bool - Indicates whether tracing is enabled.
- Api
Id string - The ID of the API assigned to this Subscription.
- Api
Management stringId - Display
Name string - The display name of this Subscription.
- Id string
- The provider-assigned unique ID for this managed resource.
- Primary
Key string - The primary key for this subscription.
- Product
Id string - The ID of the Product assigned to this Subscription.
- Secondary
Key string - The secondary key for this subscription.
- State string
- The state of this Subscription.
- Subscription
Id string - User
Id string - The ID of the User assigned to this Subscription.
- Allow
Tracing bool - Indicates whether tracing is enabled.
- Api
Id string - The ID of the API assigned to this Subscription.
- Api
Management stringId - Display
Name string - The display name of this Subscription.
- Id string
- The provider-assigned unique ID for this managed resource.
- Primary
Key string - The primary key for this subscription.
- Product
Id string - The ID of the Product assigned to this Subscription.
- Secondary
Key string - The secondary key for this subscription.
- State string
- The state of this Subscription.
- Subscription
Id string - User
Id string - The ID of the User assigned to this Subscription.
- allow
Tracing Boolean - Indicates whether tracing is enabled.
- api
Id String - The ID of the API assigned to this Subscription.
- api
Management StringId - display
Name String - The display name of this Subscription.
- id String
- The provider-assigned unique ID for this managed resource.
- primary
Key String - The primary key for this subscription.
- product
Id String - The ID of the Product assigned to this Subscription.
- secondary
Key String - The secondary key for this subscription.
- state String
- The state of this Subscription.
- subscription
Id String - user
Id String - The ID of the User assigned to this Subscription.
- allow
Tracing boolean - Indicates whether tracing is enabled.
- api
Id string - The ID of the API assigned to this Subscription.
- api
Management stringId - display
Name string - The display name of this Subscription.
- id string
- The provider-assigned unique ID for this managed resource.
- primary
Key string - The primary key for this subscription.
- product
Id string - The ID of the Product assigned to this Subscription.
- secondary
Key string - The secondary key for this subscription.
- state string
- The state of this Subscription.
- subscription
Id string - user
Id string - The ID of the User assigned to this Subscription.
- allow_
tracing bool - Indicates whether tracing is enabled.
- api_
id str - The ID of the API assigned to this Subscription.
- api_
management_ strid - display_
name str - The display name of this Subscription.
- id str
- The provider-assigned unique ID for this managed resource.
- primary_
key str - The primary key for this subscription.
- product_
id str - The ID of the Product assigned to this Subscription.
- secondary_
key str - The secondary key for this subscription.
- state str
- The state of this Subscription.
- subscription_
id str - user_
id str - The ID of the User assigned to this Subscription.
- allow
Tracing Boolean - Indicates whether tracing is enabled.
- api
Id String - The ID of the API assigned to this Subscription.
- api
Management StringId - display
Name String - The display name of this Subscription.
- id String
- The provider-assigned unique ID for this managed resource.
- primary
Key String - The primary key for this subscription.
- product
Id String - The ID of the Product assigned to this Subscription.
- secondary
Key String - The secondary key for this subscription.
- state String
- The state of this Subscription.
- subscription
Id String - user
Id String - The ID of the User assigned to this Subscription.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
