GetSubscriptions

Use this data source to access information about all the Subscriptions currently available.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var available = Output.Create(Azure.Core.GetSubscriptions.InvokeAsync());
        this.AvailableSubscriptions = available.Apply(available => available.Subscriptions);
        this.FirstAvailableSubscriptionDisplayName = available.Apply(available => available.Subscriptions[0].DisplayName);
    }

    [Output("availableSubscriptions")]
    public Output<string> AvailableSubscriptions { get; set; }
    [Output("firstAvailableSubscriptionDisplayName")]
    public Output<string> FirstAvailableSubscriptionDisplayName { get; set; }
}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        available, err := core.GetSubscriptions(ctx, nil, nil)
        if err != nil {
            return err
        }
        ctx.Export("availableSubscriptions", available.Subscriptions)
        ctx.Export("firstAvailableSubscriptionDisplayName", available.Subscriptions[0].DisplayName)
        return nil
    })
}
import pulumi
import pulumi_azure as azure

available = azure.core.get_subscriptions()
pulumi.export("availableSubscriptions", available.subscriptions)
pulumi.export("firstAvailableSubscriptionDisplayName", available.subscriptions[0]["display_name"])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const available = azure.core.getSubscriptions({});
export const availableSubscriptions = available.then(available => available.subscriptions);
export const firstAvailableSubscriptionDisplayName = available.then(available => available.subscriptions[0].displayName);

Using GetSubscriptions

function getSubscriptions(args: GetSubscriptionsArgs, opts?: InvokeOptions): Promise<GetSubscriptionsResult>
function  get_subscriptions(display_name_contains=None, display_name_prefix=None, opts=None)
func GetSubscriptions(ctx *Context, args *GetSubscriptionsArgs, opts ...InvokeOption) (*GetSubscriptionsResult, error)
public static class GetSubscriptions {
    public static Task<GetSubscriptionsResult> InvokeAsync(GetSubscriptionsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

DisplayNameContains string

A case-insensitive value which must be contained within the display_name field, used to filter the results

DisplayNamePrefix string

A case-insensitive prefix which can be used to filter on the display_name field

DisplayNameContains string

A case-insensitive value which must be contained within the display_name field, used to filter the results

DisplayNamePrefix string

A case-insensitive prefix which can be used to filter on the display_name field

displayNameContains string

A case-insensitive value which must be contained within the display_name field, used to filter the results

displayNamePrefix string

A case-insensitive prefix which can be used to filter on the display_name field

display_name_contains str

A case-insensitive value which must be contained within the display_name field, used to filter the results

display_name_prefix str

A case-insensitive prefix which can be used to filter on the display_name field

GetSubscriptions Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Subscriptions List<GetSubscriptionsSubscription>

One or more subscription blocks as defined below.

DisplayNameContains string
DisplayNamePrefix string
Id string

The provider-assigned unique ID for this managed resource.

Subscriptions []GetSubscriptionsSubscription

One or more subscription blocks as defined below.

DisplayNameContains string
DisplayNamePrefix string
id string

The provider-assigned unique ID for this managed resource.

subscriptions GetSubscriptionsSubscription[]

One or more subscription blocks as defined below.

displayNameContains string
displayNamePrefix string
id str

The provider-assigned unique ID for this managed resource.

subscriptions List[GetSubscriptionsSubscription]

One or more subscription blocks as defined below.

display_name_contains str
display_name_prefix str

Supporting Types

GetSubscriptionsSubscription

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

DisplayName string

The subscription display name.

LocationPlacementId string

The subscription location placement ID.

QuotaId string

The subscription quota ID.

SpendingLimit string

The subscription spending limit.

State string

The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.

SubscriptionId string

The subscription GUID.

TenantId string

The subscription tenant ID.

DisplayName string

The subscription display name.

LocationPlacementId string

The subscription location placement ID.

QuotaId string

The subscription quota ID.

SpendingLimit string

The subscription spending limit.

State string

The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.

SubscriptionId string

The subscription GUID.

TenantId string

The subscription tenant ID.

displayName string

The subscription display name.

locationPlacementId string

The subscription location placement ID.

quotaId string

The subscription quota ID.

spendingLimit string

The subscription spending limit.

state string

The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.

subscriptionId string

The subscription GUID.

tenantId string

The subscription tenant ID.

display_name str

The subscription display name.

locationPlacementId str

The subscription location placement ID.

quotaId str

The subscription quota ID.

spendingLimit str

The subscription spending limit.

state str

The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.

subscription_id str

The subscription GUID.

tenant_id str

The subscription tenant ID.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.