We recommend using Azure Native.
azure.core.Subscription
Explore with Pulumi AI
Example Usage
Creating A New Alias And Subscription For An Enrollment Account
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.billing.getEnrollmentAccountScope({
billingAccountName: "1234567890",
enrollmentAccountName: "0123456",
});
const exampleSubscription = new azure.core.Subscription("example", {
subscriptionName: "My Example EA Subscription",
billingScopeId: example.then(example => example.id),
});
import pulumi
import pulumi_azure as azure
example = azure.billing.get_enrollment_account_scope(billing_account_name="1234567890",
enrollment_account_name="0123456")
example_subscription = azure.core.Subscription("example",
subscription_name="My Example EA Subscription",
billing_scope_id=example.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/billing"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := billing.GetEnrollmentAccountScope(ctx, &billing.GetEnrollmentAccountScopeArgs{
BillingAccountName: "1234567890",
EnrollmentAccountName: "0123456",
}, nil)
if err != nil {
return err
}
_, err = core.NewSubscription(ctx, "example", &core.SubscriptionArgs{
SubscriptionName: pulumi.String("My Example EA Subscription"),
BillingScopeId: pulumi.String(example.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Billing.GetEnrollmentAccountScope.Invoke(new()
{
BillingAccountName = "1234567890",
EnrollmentAccountName = "0123456",
});
var exampleSubscription = new Azure.Core.Subscription("example", new()
{
SubscriptionName = "My Example EA Subscription",
BillingScopeId = example.Apply(getEnrollmentAccountScopeResult => getEnrollmentAccountScopeResult.Id),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.billing.BillingFunctions;
import com.pulumi.azure.billing.inputs.GetEnrollmentAccountScopeArgs;
import com.pulumi.azure.core.Subscription;
import com.pulumi.azure.core.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 = BillingFunctions.getEnrollmentAccountScope(GetEnrollmentAccountScopeArgs.builder()
.billingAccountName("1234567890")
.enrollmentAccountName("0123456")
.build());
var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
.subscriptionName("My Example EA Subscription")
.billingScopeId(example.applyValue(getEnrollmentAccountScopeResult -> getEnrollmentAccountScopeResult.id()))
.build());
}
}
resources:
exampleSubscription:
type: azure:core:Subscription
name: example
properties:
subscriptionName: My Example EA Subscription
billingScopeId: ${example.id}
variables:
example:
fn::invoke:
Function: azure:billing:getEnrollmentAccountScope
Arguments:
billingAccountName: '1234567890'
enrollmentAccountName: '0123456'
Creating A New Alias And Subscription For A Microsoft Customer Account
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.billing.getMcaAccountScope({
billingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31",
billingProfileName: "PE2Q-NOIT-BG7-TGB",
invoiceSectionName: "MTT4-OBS7-PJA-TGB",
});
const exampleSubscription = new azure.core.Subscription("example", {
subscriptionName: "My Example MCA Subscription",
billingScopeId: example.then(example => example.id),
});
import pulumi
import pulumi_azure as azure
example = azure.billing.get_mca_account_scope(billing_account_name="e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31",
billing_profile_name="PE2Q-NOIT-BG7-TGB",
invoice_section_name="MTT4-OBS7-PJA-TGB")
example_subscription = azure.core.Subscription("example",
subscription_name="My Example MCA Subscription",
billing_scope_id=example.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/billing"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := billing.GetMcaAccountScope(ctx, &billing.GetMcaAccountScopeArgs{
BillingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31",
BillingProfileName: "PE2Q-NOIT-BG7-TGB",
InvoiceSectionName: "MTT4-OBS7-PJA-TGB",
}, nil)
if err != nil {
return err
}
_, err = core.NewSubscription(ctx, "example", &core.SubscriptionArgs{
SubscriptionName: pulumi.String("My Example MCA Subscription"),
BillingScopeId: pulumi.String(example.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Billing.GetMcaAccountScope.Invoke(new()
{
BillingAccountName = "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31",
BillingProfileName = "PE2Q-NOIT-BG7-TGB",
InvoiceSectionName = "MTT4-OBS7-PJA-TGB",
});
var exampleSubscription = new Azure.Core.Subscription("example", new()
{
SubscriptionName = "My Example MCA Subscription",
BillingScopeId = example.Apply(getMcaAccountScopeResult => getMcaAccountScopeResult.Id),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.billing.BillingFunctions;
import com.pulumi.azure.billing.inputs.GetMcaAccountScopeArgs;
import com.pulumi.azure.core.Subscription;
import com.pulumi.azure.core.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 = BillingFunctions.getMcaAccountScope(GetMcaAccountScopeArgs.builder()
.billingAccountName("e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31")
.billingProfileName("PE2Q-NOIT-BG7-TGB")
.invoiceSectionName("MTT4-OBS7-PJA-TGB")
.build());
var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
.subscriptionName("My Example MCA Subscription")
.billingScopeId(example.applyValue(getMcaAccountScopeResult -> getMcaAccountScopeResult.id()))
.build());
}
}
resources:
exampleSubscription:
type: azure:core:Subscription
name: example
properties:
subscriptionName: My Example MCA Subscription
billingScopeId: ${example.id}
variables:
example:
fn::invoke:
Function: azure:billing:getMcaAccountScope
Arguments:
billingAccountName: e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31
billingProfileName: PE2Q-NOIT-BG7-TGB
invoiceSectionName: MTT4-OBS7-PJA-TGB
Creating A New Alias And Subscription For A Microsoft Partner Account
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.billing.getMpaAccountScope({
billingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31",
customerName: "2281f543-7321-4cf9-1e23-edb4Oc31a31c",
});
const exampleSubscription = new azure.core.Subscription("example", {
subscriptionName: "My Example MPA Subscription",
billingScopeId: example.then(example => example.id),
});
import pulumi
import pulumi_azure as azure
example = azure.billing.get_mpa_account_scope(billing_account_name="e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31",
customer_name="2281f543-7321-4cf9-1e23-edb4Oc31a31c")
example_subscription = azure.core.Subscription("example",
subscription_name="My Example MPA Subscription",
billing_scope_id=example.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/billing"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := billing.GetMpaAccountScope(ctx, &billing.GetMpaAccountScopeArgs{
BillingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31",
CustomerName: "2281f543-7321-4cf9-1e23-edb4Oc31a31c",
}, nil)
if err != nil {
return err
}
_, err = core.NewSubscription(ctx, "example", &core.SubscriptionArgs{
SubscriptionName: pulumi.String("My Example MPA Subscription"),
BillingScopeId: pulumi.String(example.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Billing.GetMpaAccountScope.Invoke(new()
{
BillingAccountName = "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31",
CustomerName = "2281f543-7321-4cf9-1e23-edb4Oc31a31c",
});
var exampleSubscription = new Azure.Core.Subscription("example", new()
{
SubscriptionName = "My Example MPA Subscription",
BillingScopeId = example.Apply(getMpaAccountScopeResult => getMpaAccountScopeResult.Id),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.billing.BillingFunctions;
import com.pulumi.azure.billing.inputs.GetMpaAccountScopeArgs;
import com.pulumi.azure.core.Subscription;
import com.pulumi.azure.core.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 = BillingFunctions.getMpaAccountScope(GetMpaAccountScopeArgs.builder()
.billingAccountName("e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31")
.customerName("2281f543-7321-4cf9-1e23-edb4Oc31a31c")
.build());
var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
.subscriptionName("My Example MPA Subscription")
.billingScopeId(example.applyValue(getMpaAccountScopeResult -> getMpaAccountScopeResult.id()))
.build());
}
}
resources:
exampleSubscription:
type: azure:core:Subscription
name: example
properties:
subscriptionName: My Example MPA Subscription
billingScopeId: ${example.id}
variables:
example:
fn::invoke:
Function: azure:billing:getMpaAccountScope
Arguments:
billingAccountName: e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31
customerName: 2281f543-7321-4cf9-1e23-edb4Oc31a31c
Adding An Alias To An Existing Subscription
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.Subscription("example", {
alias: "examplesub",
subscriptionName: "My Example Subscription",
subscriptionId: "12345678-12234-5678-9012-123456789012",
});
import pulumi
import pulumi_azure as azure
example = azure.core.Subscription("example",
alias="examplesub",
subscription_name="My Example Subscription",
subscription_id="12345678-12234-5678-9012-123456789012")
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := core.NewSubscription(ctx, "example", &core.SubscriptionArgs{
Alias: pulumi.String("examplesub"),
SubscriptionName: pulumi.String("My Example Subscription"),
SubscriptionId: pulumi.String("12345678-12234-5678-9012-123456789012"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.Subscription("example", new()
{
Alias = "examplesub",
SubscriptionName = "My Example Subscription",
SubscriptionId = "12345678-12234-5678-9012-123456789012",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.Subscription;
import com.pulumi.azure.core.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) {
var example = new Subscription("example", SubscriptionArgs.builder()
.alias("examplesub")
.subscriptionName("My Example Subscription")
.subscriptionId("12345678-12234-5678-9012-123456789012")
.build());
}
}
resources:
example:
type: azure:core:Subscription
properties:
alias: examplesub
subscriptionName: My Example Subscription
subscriptionId: 12345678-12234-5678-9012-123456789012
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,
subscription_name: Optional[str] = None,
alias: Optional[str] = None,
billing_scope_id: Optional[str] = None,
subscription_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
workload: 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:core:Subscription
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SubscriptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args SubscriptionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SubscriptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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 azureSubscriptionResource = new Azure.Core.Subscription("azureSubscriptionResource", new()
{
SubscriptionName = "string",
Alias = "string",
BillingScopeId = "string",
SubscriptionId = "string",
Tags =
{
{ "string", "string" },
},
Workload = "string",
});
example, err := core.NewSubscription(ctx, "azureSubscriptionResource", &core.SubscriptionArgs{
SubscriptionName: pulumi.String("string"),
Alias: pulumi.String("string"),
BillingScopeId: pulumi.String("string"),
SubscriptionId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
Workload: pulumi.String("string"),
})
var azureSubscriptionResource = new Subscription("azureSubscriptionResource", SubscriptionArgs.builder()
.subscriptionName("string")
.alias("string")
.billingScopeId("string")
.subscriptionId("string")
.tags(Map.of("string", "string"))
.workload("string")
.build());
azure_subscription_resource = azure.core.Subscription("azureSubscriptionResource",
subscription_name="string",
alias="string",
billing_scope_id="string",
subscription_id="string",
tags={
"string": "string",
},
workload="string")
const azureSubscriptionResource = new azure.core.Subscription("azureSubscriptionResource", {
subscriptionName: "string",
alias: "string",
billingScopeId: "string",
subscriptionId: "string",
tags: {
string: "string",
},
workload: "string",
});
type: azure:core:Subscription
properties:
alias: string
billingScopeId: string
subscriptionId: string
subscriptionName: string
tags:
string: string
workload: string
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:
- Subscription
Name string - The Name of the Subscription. This is the Display Name in the portal.
- Alias string
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- Billing
Scope stringId - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- Subscription
Id string The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- Dictionary<string, string>
- A mapping of tags to assign to the Subscription.
- Workload string
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
- Subscription
Name string - The Name of the Subscription. This is the Display Name in the portal.
- Alias string
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- Billing
Scope stringId - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- Subscription
Id string The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- map[string]string
- A mapping of tags to assign to the Subscription.
- Workload string
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
- subscription
Name String - The Name of the Subscription. This is the Display Name in the portal.
- alias String
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- billing
Scope StringId - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- subscription
Id String The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- Map<String,String>
- A mapping of tags to assign to the Subscription.
- workload String
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
- subscription
Name string - The Name of the Subscription. This is the Display Name in the portal.
- alias string
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- billing
Scope stringId - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- subscription
Id string The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- {[key: string]: string}
- A mapping of tags to assign to the Subscription.
- workload string
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
- subscription_
name str - The Name of the Subscription. This is the Display Name in the portal.
- alias str
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- billing_
scope_ strid - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- subscription_
id str The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- Mapping[str, str]
- A mapping of tags to assign to the Subscription.
- workload str
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
- subscription
Name String - The Name of the Subscription. This is the Display Name in the portal.
- alias String
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- billing
Scope StringId - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- subscription
Id String The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- Map<String>
- A mapping of tags to assign to the Subscription.
- workload String
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Subscription resource produces the following output properties:
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,
alias: Optional[str] = None,
billing_scope_id: Optional[str] = None,
subscription_id: Optional[str] = None,
subscription_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tenant_id: Optional[str] = None,
workload: 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)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Alias string
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- Billing
Scope stringId - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- Subscription
Id string The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- Subscription
Name string - The Name of the Subscription. This is the Display Name in the portal.
- Dictionary<string, string>
- A mapping of tags to assign to the Subscription.
- Tenant
Id string - The ID of the Tenant to which the subscription belongs.
- Workload string
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
- Alias string
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- Billing
Scope stringId - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- Subscription
Id string The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- Subscription
Name string - The Name of the Subscription. This is the Display Name in the portal.
- map[string]string
- A mapping of tags to assign to the Subscription.
- Tenant
Id string - The ID of the Tenant to which the subscription belongs.
- Workload string
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
- alias String
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- billing
Scope StringId - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- subscription
Id String The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- subscription
Name String - The Name of the Subscription. This is the Display Name in the portal.
- Map<String,String>
- A mapping of tags to assign to the Subscription.
- tenant
Id String - The ID of the Tenant to which the subscription belongs.
- workload String
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
- alias string
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- billing
Scope stringId - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- subscription
Id string The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- subscription
Name string - The Name of the Subscription. This is the Display Name in the portal.
- {[key: string]: string}
- A mapping of tags to assign to the Subscription.
- tenant
Id string - The ID of the Tenant to which the subscription belongs.
- workload string
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
- alias str
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- billing_
scope_ strid - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- subscription_
id str The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- subscription_
name str - The Name of the Subscription. This is the Display Name in the portal.
- Mapping[str, str]
- A mapping of tags to assign to the Subscription.
- tenant_
id str - The ID of the Tenant to which the subscription belongs.
- workload str
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
- alias String
- The Alias name for the subscription. This provider will generate a new GUID if this is not supplied. Changing this forces a new Subscription to be created.
- billing
Scope StringId - The Azure Billing Scope ID. Can be a Microsoft Customer Account Billing Scope ID, a Microsoft Partner Account Billing Scope ID or an Enrollment Billing Scope ID.
- subscription
Id String The ID of the Subscription. Changing this forces a new Subscription to be created.
NOTE: This value can be specified only for adopting control of an existing Subscription, it cannot be used to provide a custom Subscription ID.
NOTE: Either
billing_scope_id
orsubscription_id
has to be specified.- subscription
Name String - The Name of the Subscription. This is the Display Name in the portal.
- Map<String>
- A mapping of tags to assign to the Subscription.
- tenant
Id String - The ID of the Tenant to which the subscription belongs.
- workload String
- The workload type of the Subscription. Possible values are
Production
(default) andDevTest
. Changing this forces a new Subscription to be created.
Import
Subscriptions can be imported using the resource id
, e.g.
$ pulumi import azure:core/subscription:Subscription example "/providers/Microsoft.Subscription/aliases/subscription1"
In this scenario, the subscription_id
property can be completed and the provider will assume control of the existing subscription by creating an Alias. See the adding an Alias to an existing Subscription
above. This provider requires an alias to correctly manage Subscription resources due to Azure Subscription API design.
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.