GetSubscription

Use this data source to access information about an existing Subscription.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var current = Output.Create(Azure.Core.GetSubscription.InvokeAsync());
        this.CurrentSubscriptionDisplayName = current.Apply(current => current.DisplayName);
    }

    [Output("currentSubscriptionDisplayName")]
    public Output<string> CurrentSubscriptionDisplayName { 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 {
        current, err := core.GetSubscription(ctx, nil, nil)
        if err != nil {
            return err
        }
        ctx.Export("currentSubscriptionDisplayName", current.DisplayName)
        return nil
    })
}
import pulumi
import pulumi_azure as azure

current = azure.core.get_subscription()
pulumi.export("currentSubscriptionDisplayName", current.display_name)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const current = azure.core.getSubscription({});
export const currentSubscriptionDisplayName = current.then(current => current.displayName);

Using GetSubscription

function getSubscription(args: GetSubscriptionArgs, opts?: InvokeOptions): Promise<GetSubscriptionResult>
function  get_subscription(subscription_id=None, opts=None)
func GetSubscription(ctx *Context, args *GetSubscriptionArgs, opts ...InvokeOption) (*GetSubscriptionResult, error)
public static class GetSubscription {
    public static Task<GetSubscriptionResult> InvokeAsync(GetSubscriptionArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

SubscriptionId string

Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.

SubscriptionId string

Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.

subscriptionId string

Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.

subscription_id str

Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.

GetSubscription Result

The following output properties are available:

DisplayName string

The subscription display name.

Id string

The provider-assigned unique ID for this managed resource.

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.

Id string

The provider-assigned unique ID for this managed resource.

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.

id string

The provider-assigned unique ID for this managed resource.

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.

id str

The provider-assigned unique ID for this managed resource.

location_placement_id str

The subscription location placement ID.

quota_id str

The subscription quota ID.

spending_limit 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.