Automating creation of Azure Subscriptions with AZ CLI

If you’ve ever tried to create Azure Subscriptions with Terraform, AZ cli or via ARM api you’ll know that it was not possible up until recently. Previously you had to open a different UI to choose a billing model and create a new Subscription (even if it was bound to the same AD Tenant as your existing Subscription). Terraform and AZ work in the context of a Subscription so it was assumed you would have one before you started, however sometimes we need to create these automatically.