1. Packages
  2. Azure Classic
  3. API Docs
  4. apimanagement
  5. Subscription

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.apimanagement.Subscription

Explore with Pulumi AI

Manages a Subscription within a API Management Service.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.apimanagement.getService({
    name: "example-apim",
    resourceGroupName: "example-resources",
});
const exampleGetProduct = Promise.all([example, example]).then(([example, example1]) => azure.apimanagement.getProduct({
    productId: "00000000-0000-0000-0000-000000000000",
    apiManagementName: example.name,
    resourceGroupName: example1.resourceGroupName,
}));
const exampleGetUser = Promise.all([example, example]).then(([example, example1]) => azure.apimanagement.getUser({
    userId: "11111111-1111-1111-1111-111111111111",
    apiManagementName: example.name,
    resourceGroupName: example1.resourceGroupName,
}));
const exampleSubscription = new azure.apimanagement.Subscription("example", {
    apiManagementName: example.then(example => example.name),
    resourceGroupName: example.then(example => example.resourceGroupName),
    userId: exampleGetUser.then(exampleGetUser => exampleGetUser.id),
    productId: exampleGetProduct.then(exampleGetProduct => exampleGetProduct.id),
    displayName: "Parser API",
});
Copy
import pulumi
import pulumi_azure as azure

example = azure.apimanagement.get_service(name="example-apim",
    resource_group_name="example-resources")
example_get_product = azure.apimanagement.get_product(product_id="00000000-0000-0000-0000-000000000000",
    api_management_name=example.name,
    resource_group_name=example.resource_group_name)
example_get_user = azure.apimanagement.get_user(user_id="11111111-1111-1111-1111-111111111111",
    api_management_name=example.name,
    resource_group_name=example.resource_group_name)
example_subscription = azure.apimanagement.Subscription("example",
    api_management_name=example.name,
    resource_group_name=example.resource_group_name,
    user_id=example_get_user.id,
    product_id=example_get_product.id,
    display_name="Parser API")
Copy
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.LookupService(ctx, &apimanagement.LookupServiceArgs{
			Name:              "example-apim",
			ResourceGroupName: "example-resources",
		}, nil)
		if err != nil {
			return err
		}
		exampleGetProduct, err := apimanagement.LookupProduct(ctx, &apimanagement.LookupProductArgs{
			ProductId:         "00000000-0000-0000-0000-000000000000",
			ApiManagementName: example.Name,
			ResourceGroupName: example.ResourceGroupName,
		}, nil)
		if err != nil {
			return err
		}
		exampleGetUser, err := apimanagement.LookupUser(ctx, &apimanagement.LookupUserArgs{
			UserId:            "11111111-1111-1111-1111-111111111111",
			ApiManagementName: example.Name,
			ResourceGroupName: example.ResourceGroupName,
		}, nil)
		if err != nil {
			return err
		}
		_, err = apimanagement.NewSubscription(ctx, "example", &apimanagement.SubscriptionArgs{
			ApiManagementName: pulumi.String(example.Name),
			ResourceGroupName: pulumi.String(example.ResourceGroupName),
			UserId:            pulumi.String(exampleGetUser.Id),
			ProductId:         pulumi.String(exampleGetProduct.Id),
			DisplayName:       pulumi.String("Parser API"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.ApiManagement.GetService.Invoke(new()
    {
        Name = "example-apim",
        ResourceGroupName = "example-resources",
    });

    var exampleGetProduct = Azure.ApiManagement.GetProduct.Invoke(new()
    {
        ProductId = "00000000-0000-0000-0000-000000000000",
        ApiManagementName = example.Apply(getServiceResult => getServiceResult.Name),
        ResourceGroupName = example.Apply(getServiceResult => getServiceResult.ResourceGroupName),
    });

    var exampleGetUser = Azure.ApiManagement.GetUser.Invoke(new()
    {
        UserId = "11111111-1111-1111-1111-111111111111",
        ApiManagementName = example.Apply(getServiceResult => getServiceResult.Name),
        ResourceGroupName = example.Apply(getServiceResult => getServiceResult.ResourceGroupName),
    });

    var exampleSubscription = new Azure.ApiManagement.Subscription("example", new()
    {
        ApiManagementName = example.Apply(getServiceResult => getServiceResult.Name),
        ResourceGroupName = example.Apply(getServiceResult => getServiceResult.ResourceGroupName),
        UserId = exampleGetUser.Apply(getUserResult => getUserResult.Id),
        ProductId = exampleGetProduct.Apply(getProductResult => getProductResult.Id),
        DisplayName = "Parser API",
    });

});
Copy
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.GetServiceArgs;
import com.pulumi.azure.apimanagement.inputs.GetProductArgs;
import com.pulumi.azure.apimanagement.inputs.GetUserArgs;
import com.pulumi.azure.apimanagement.Subscription;
import com.pulumi.azure.apimanagement.SubscriptionArgs;
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.getService(GetServiceArgs.builder()
            .name("example-apim")
            .resourceGroupName("example-resources")
            .build());

        final var exampleGetProduct = ApimanagementFunctions.getProduct(GetProductArgs.builder()
            .productId("00000000-0000-0000-0000-000000000000")
            .apiManagementName(example.applyValue(getServiceResult -> getServiceResult.name()))
            .resourceGroupName(example.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
            .build());

        final var exampleGetUser = ApimanagementFunctions.getUser(GetUserArgs.builder()
            .userId("11111111-1111-1111-1111-111111111111")
            .apiManagementName(example.applyValue(getServiceResult -> getServiceResult.name()))
            .resourceGroupName(example.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
            .build());

        var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
            .apiManagementName(example.applyValue(getServiceResult -> getServiceResult.name()))
            .resourceGroupName(example.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
            .userId(exampleGetUser.applyValue(getUserResult -> getUserResult.id()))
            .productId(exampleGetProduct.applyValue(getProductResult -> getProductResult.id()))
            .displayName("Parser API")
            .build());

    }
}
Copy
resources:
  exampleSubscription:
    type: azure:apimanagement:Subscription
    name: example
    properties:
      apiManagementName: ${example.name}
      resourceGroupName: ${example.resourceGroupName}
      userId: ${exampleGetUser.id}
      productId: ${exampleGetProduct.id}
      displayName: Parser API
variables:
  example:
    fn::invoke:
      function: azure:apimanagement:getService
      arguments:
        name: example-apim
        resourceGroupName: example-resources
  exampleGetProduct:
    fn::invoke:
      function: azure:apimanagement:getProduct
      arguments:
        productId: 00000000-0000-0000-0000-000000000000
        apiManagementName: ${example.name}
        resourceGroupName: ${example.resourceGroupName}
  exampleGetUser:
    fn::invoke:
      function: azure:apimanagement:getUser
      arguments:
        userId: 11111111-1111-1111-1111-111111111111
        apiManagementName: ${example.name}
        resourceGroupName: ${example.resourceGroupName}
Copy

Create Subscription Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Subscription(name: string, args: SubscriptionArgs, opts?: CustomResourceOptions);
@overload
def Subscription(resource_name: str,
                 args: SubscriptionArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def Subscription(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 api_management_name: Optional[str] = None,
                 display_name: Optional[str] = None,
                 resource_group_name: Optional[str] = None,
                 allow_tracing: Optional[bool] = None,
                 api_id: Optional[str] = None,
                 primary_key: Optional[str] = None,
                 product_id: Optional[str] = None,
                 secondary_key: Optional[str] = None,
                 state: Optional[str] = None,
                 subscription_id: Optional[str] = None,
                 user_id: Optional[str] = None)
func NewSubscription(ctx *Context, name string, args SubscriptionArgs, opts ...ResourceOption) (*Subscription, error)
public Subscription(string name, SubscriptionArgs args, CustomResourceOptions? opts = null)
public Subscription(String name, SubscriptionArgs args)
public Subscription(String name, SubscriptionArgs args, CustomResourceOptions options)
type: azure:apimanagement:Subscription
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SubscriptionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SubscriptionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SubscriptionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var subscriptionResource = new Azure.ApiManagement.Subscription("subscriptionResource", new()
{
    ApiManagementName = "string",
    DisplayName = "string",
    ResourceGroupName = "string",
    AllowTracing = false,
    ApiId = "string",
    PrimaryKey = "string",
    ProductId = "string",
    SecondaryKey = "string",
    State = "string",
    SubscriptionId = "string",
    UserId = "string",
});
Copy
example, err := apimanagement.NewSubscription(ctx, "subscriptionResource", &apimanagement.SubscriptionArgs{
	ApiManagementName: pulumi.String("string"),
	DisplayName:       pulumi.String("string"),
	ResourceGroupName: pulumi.String("string"),
	AllowTracing:      pulumi.Bool(false),
	ApiId:             pulumi.String("string"),
	PrimaryKey:        pulumi.String("string"),
	ProductId:         pulumi.String("string"),
	SecondaryKey:      pulumi.String("string"),
	State:             pulumi.String("string"),
	SubscriptionId:    pulumi.String("string"),
	UserId:            pulumi.String("string"),
})
Copy
var subscriptionResource = new com.pulumi.azure.apimanagement.Subscription("subscriptionResource", com.pulumi.azure.apimanagement.SubscriptionArgs.builder()
    .apiManagementName("string")
    .displayName("string")
    .resourceGroupName("string")
    .allowTracing(false)
    .apiId("string")
    .primaryKey("string")
    .productId("string")
    .secondaryKey("string")
    .state("string")
    .subscriptionId("string")
    .userId("string")
    .build());
Copy
subscription_resource = azure.apimanagement.Subscription("subscriptionResource",
    api_management_name="string",
    display_name="string",
    resource_group_name="string",
    allow_tracing=False,
    api_id="string",
    primary_key="string",
    product_id="string",
    secondary_key="string",
    state="string",
    subscription_id="string",
    user_id="string")
Copy
const subscriptionResource = new azure.apimanagement.Subscription("subscriptionResource", {
    apiManagementName: "string",
    displayName: "string",
    resourceGroupName: "string",
    allowTracing: false,
    apiId: "string",
    primaryKey: "string",
    productId: "string",
    secondaryKey: "string",
    state: "string",
    subscriptionId: "string",
    userId: "string",
});
Copy
type: azure:apimanagement:Subscription
properties:
    allowTracing: false
    apiId: string
    apiManagementName: string
    displayName: string
    primaryKey: string
    productId: string
    resourceGroupName: string
    secondaryKey: string
    state: string
    subscriptionId: string
    userId: string
Copy

Subscription Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Subscription resource accepts the following input properties:

ApiManagementName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
DisplayName This property is required. string
The display name of this Subscription.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
AllowTracing bool
Determines whether tracing can be enabled. Defaults to true.
ApiId Changes to this property will trigger replacement. string

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

PrimaryKey string
The primary subscription key to use for the subscription.
ProductId Changes to this property will trigger replacement. string

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

SecondaryKey string
The secondary subscription key to use for the subscription.
State string
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
SubscriptionId Changes to this property will trigger replacement. string
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
UserId Changes to this property will trigger replacement. string
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
ApiManagementName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
DisplayName This property is required. string
The display name of this Subscription.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
AllowTracing bool
Determines whether tracing can be enabled. Defaults to true.
ApiId Changes to this property will trigger replacement. string

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

PrimaryKey string
The primary subscription key to use for the subscription.
ProductId Changes to this property will trigger replacement. string

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

SecondaryKey string
The secondary subscription key to use for the subscription.
State string
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
SubscriptionId Changes to this property will trigger replacement. string
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
UserId Changes to this property will trigger replacement. string
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
apiManagementName
This property is required.
Changes to this property will trigger replacement.
String
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
displayName This property is required. String
The display name of this Subscription.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
allowTracing Boolean
Determines whether tracing can be enabled. Defaults to true.
apiId Changes to this property will trigger replacement. String

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

primaryKey String
The primary subscription key to use for the subscription.
productId Changes to this property will trigger replacement. String

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

secondaryKey String
The secondary subscription key to use for the subscription.
state String
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
subscriptionId Changes to this property will trigger replacement. String
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
userId Changes to this property will trigger replacement. String
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
apiManagementName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
displayName This property is required. string
The display name of this Subscription.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
allowTracing boolean
Determines whether tracing can be enabled. Defaults to true.
apiId Changes to this property will trigger replacement. string

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

primaryKey string
The primary subscription key to use for the subscription.
productId Changes to this property will trigger replacement. string

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

secondaryKey string
The secondary subscription key to use for the subscription.
state string
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
subscriptionId Changes to this property will trigger replacement. string
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
userId Changes to this property will trigger replacement. string
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
api_management_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
display_name This property is required. str
The display name of this Subscription.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
allow_tracing bool
Determines whether tracing can be enabled. Defaults to true.
api_id Changes to this property will trigger replacement. str

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

primary_key str
The primary subscription key to use for the subscription.
product_id Changes to this property will trigger replacement. str

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

secondary_key str
The secondary subscription key to use for the subscription.
state str
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
subscription_id Changes to this property will trigger replacement. str
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
user_id Changes to this property will trigger replacement. str
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
apiManagementName
This property is required.
Changes to this property will trigger replacement.
String
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
displayName This property is required. String
The display name of this Subscription.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
allowTracing Boolean
Determines whether tracing can be enabled. Defaults to true.
apiId Changes to this property will trigger replacement. String

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

primaryKey String
The primary subscription key to use for the subscription.
productId Changes to this property will trigger replacement. String

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

secondaryKey String
The secondary subscription key to use for the subscription.
state String
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
subscriptionId Changes to this property will trigger replacement. String
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
userId Changes to this property will trigger replacement. String
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the Subscription resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Subscription Resource

Get an existing Subscription resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SubscriptionState, opts?: CustomResourceOptions): Subscription
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allow_tracing: Optional[bool] = None,
        api_id: Optional[str] = None,
        api_management_name: Optional[str] = None,
        display_name: Optional[str] = None,
        primary_key: Optional[str] = None,
        product_id: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        secondary_key: Optional[str] = None,
        state: Optional[str] = None,
        subscription_id: Optional[str] = None,
        user_id: Optional[str] = None) -> Subscription
func GetSubscription(ctx *Context, name string, id IDInput, state *SubscriptionState, opts ...ResourceOption) (*Subscription, error)
public static Subscription Get(string name, Input<string> id, SubscriptionState? state, CustomResourceOptions? opts = null)
public static Subscription get(String name, Output<String> id, SubscriptionState state, CustomResourceOptions options)
resources:  _:    type: azure:apimanagement:Subscription    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AllowTracing bool
Determines whether tracing can be enabled. Defaults to true.
ApiId Changes to this property will trigger replacement. string

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

ApiManagementName Changes to this property will trigger replacement. string
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
DisplayName string
The display name of this Subscription.
PrimaryKey string
The primary subscription key to use for the subscription.
ProductId Changes to this property will trigger replacement. string

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

ResourceGroupName Changes to this property will trigger replacement. string
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
SecondaryKey string
The secondary subscription key to use for the subscription.
State string
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
SubscriptionId Changes to this property will trigger replacement. string
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
UserId Changes to this property will trigger replacement. string
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
AllowTracing bool
Determines whether tracing can be enabled. Defaults to true.
ApiId Changes to this property will trigger replacement. string

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

ApiManagementName Changes to this property will trigger replacement. string
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
DisplayName string
The display name of this Subscription.
PrimaryKey string
The primary subscription key to use for the subscription.
ProductId Changes to this property will trigger replacement. string

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

ResourceGroupName Changes to this property will trigger replacement. string
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
SecondaryKey string
The secondary subscription key to use for the subscription.
State string
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
SubscriptionId Changes to this property will trigger replacement. string
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
UserId Changes to this property will trigger replacement. string
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
allowTracing Boolean
Determines whether tracing can be enabled. Defaults to true.
apiId Changes to this property will trigger replacement. String

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

apiManagementName Changes to this property will trigger replacement. String
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
displayName String
The display name of this Subscription.
primaryKey String
The primary subscription key to use for the subscription.
productId Changes to this property will trigger replacement. String

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

resourceGroupName Changes to this property will trigger replacement. String
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
secondaryKey String
The secondary subscription key to use for the subscription.
state String
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
subscriptionId Changes to this property will trigger replacement. String
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
userId Changes to this property will trigger replacement. String
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
allowTracing boolean
Determines whether tracing can be enabled. Defaults to true.
apiId Changes to this property will trigger replacement. string

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

apiManagementName Changes to this property will trigger replacement. string
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
displayName string
The display name of this Subscription.
primaryKey string
The primary subscription key to use for the subscription.
productId Changes to this property will trigger replacement. string

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

resourceGroupName Changes to this property will trigger replacement. string
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
secondaryKey string
The secondary subscription key to use for the subscription.
state string
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
subscriptionId Changes to this property will trigger replacement. string
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
userId Changes to this property will trigger replacement. string
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
allow_tracing bool
Determines whether tracing can be enabled. Defaults to true.
api_id Changes to this property will trigger replacement. str

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

api_management_name Changes to this property will trigger replacement. str
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
display_name str
The display name of this Subscription.
primary_key str
The primary subscription key to use for the subscription.
product_id Changes to this property will trigger replacement. str

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

resource_group_name Changes to this property will trigger replacement. str
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
secondary_key str
The secondary subscription key to use for the subscription.
state str
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
subscription_id Changes to this property will trigger replacement. str
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
user_id Changes to this property will trigger replacement. str
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.
allowTracing Boolean
Determines whether tracing can be enabled. Defaults to true.
apiId Changes to this property will trigger replacement. String

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing /apis scope is used for the subscription and all apis are accessible.

apiManagementName Changes to this property will trigger replacement. String
The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.
displayName String
The display name of this Subscription.
primaryKey String
The primary subscription key to use for the subscription.
productId Changes to this property will trigger replacement. String

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Info: Only one of product_id and api_id can be set. If both are missing all_apis scope is used for the subscription.

resourceGroupName Changes to this property will trigger replacement. String
The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
secondaryKey String
The secondary subscription key to use for the subscription.
state String
The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.
subscriptionId Changes to this property will trigger replacement. String
An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.
userId Changes to this property will trigger replacement. String
The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.

Import

API Management Subscriptions can be imported using the resource id, e.g.

$ pulumi import azure:apimanagement/subscription:Subscription example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.ApiManagement/service/example-apim/subscriptions/subscription-name
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.