bitter-cat-65329
10/14/2024, 8:46 PMadventurous-butcher-54166
10/15/2024, 10:26 AMCost Management + Billing
- Billing Scopes
-Properties
Using the following inputs on Subscription:
enrollment_account_name
(Account ID from the properties view)
billing_scope_id
(Billing Account ID from the properties view)
I believe you can only create Subscriptions programmatically when your account is under the Microsoft Customer Agreement (MCA) or Enterprise Agreement (EA) models. I think Pay-as-you-go subscriptions from the Microsoft Online Subscription Agreement can't be provisioned programmatically.salmon-guitar-84472
10/15/2024, 12:32 PMbitter-cat-65329
10/15/2024, 9:20 PMadventurous-butcher-54166
10/15/2024, 9:23 PMbitter-cat-65329
10/15/2024, 9:26 PMadventurous-butcher-54166
10/15/2024, 9:30 PMbitter-cat-65329
10/15/2024, 9:31 PMbitter-cat-65329
10/15/2024, 9:33 PMsub = azure.core.Subscription(...)
rg = azure.resources.ResourceGroup( how do i create this in the above subsription ?)
adventurous-butcher-54166
10/15/2024, 9:45 PMfrom pulumi_azure_native import Provider
sub = azure.core.Subscription(...)
new_provider = Provider(
subscription_id=sub.subscription_id,
...
)
Then to use that provider for resource creation:
SomeResource(
...,
opts=pulumi.ResourceOptions(provider=new_provider)
)
You can also consider creating a subscription within one Pulumi project, exporting the subscription details as outputs and use stack references in downstream projects. This blog post by @billowy-army-68599 provides good advise on how to layer IaC projects which f.x. recommends splitting up resources by their rate of change with subscriptions probably being among the rarest resource you'd make frequent changes to.bitter-cat-65329
10/15/2024, 10:20 PM