I want to automate the process of creating a new Azure subscription and add all the necessary custom roles and resources required for a new environment. The problem I'm stuck on is the first step of creating the new subscription.
I created an app and gave it the role Azure subscription creator at the invoice profile level, but when I run my script, the line with New-AzSubscriptionAlias keeps throwing an error:
"You do not have sufficient permissions on the specified invoice section to create an Azure subscription. Refer(http://aka.ms/mca-section-invoice) to set the right permissions and try again"
For some reason, this issue also occurs when I run the code directly in the CLI with my user, who has the same assigned role, even though I'm able to manually create a subscription through the portal.
The line that I try to run is
New-AzSubscriptionAlias -AliasName "test" -SubscriptionName "test"
-BillingScope "/providers/Microsoft.Billing/billingAccounts/****/billingProfiles/****/invoiceSections/****"
-Workload "DevTest"
Is there some difference in the permissions you do in the portal compared to the CLI?