title: Azure Subscription creation using Terraform
body: <p>We are trying to spin up an azure subscription using terraform. But unable to find any exact code which delivers successful subscription creation. Below is the brief description of the possible scenarios we have tried executing.</p>
  <ol>
  <li><p>We used the below code and executed it and the role we had was
  <code>Account Owner Role</code> -But the code is successful but we aren't able to
  see the subscription in the portal. Link for the code:</p>
  <p><a href="https://github.com/aztfmod/terraform-azurerm-caf/tree/5.4.8/modules/subscriptions" rel="nofollow noreferrer">https://github.com/aztfmod/terraform-azurerm-caf/tree/5.4.8/modules/subscriptions</a></p>
  </li>
  <li><p>Below is the next code we tested with again <code>Account Owner role</code> - But
  the error message is below. Link for the code: <a href="https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subscription#example-usage---creating-a-new-alias-and-subscription-for-a-microsoft-customer-account" rel="nofollow noreferrer">https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subscription#example-usage---creating-a-new-alias-and-subscription-for-a-microsoft-customer-account</a></p>
  <pre><code>Error Message: creating new Subscription (Alias &quot;XXXX7&quot;):
  subscription.AliasClient#Create: Failure sending request:
  StatusCode=0 -- Original Error: Code=&quot;InvalidSubCreationScope&quot;
  Message=&quot;Not a valid subscription creation scope&quot;, with
  azurerm_subscription.testtf, on main.tf line 31, in resource
  &quot;azurerm_subscription&quot; &quot;testtf&quot;:   31: resouce
  &quot;azurerm_subscription&quot; &quot;testtf&quot; {
  </code></pre>
  </li>
  <li><p>Another code we tried executing - But its destroying the older
  subscription. Link for the code is same:
  <a href="https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subscription#example-usage---creating-a-new-alias-and-subscription-for-a-microsoft-customer-account" rel="nofollow noreferrer">https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subscription#example-usage---creating-a-new-alias-and-subscription-for-a-microsoft-customer-account</a></p>
  </li>
  </ol>
  <p>Request any suggestions/help at the earliest for the same so can help us.
  Thanks in Advance!</p>