question

MSTechie-7364 avatar image
0 Votes"
MSTechie-7364 asked Monalla-MSFT commented

New-AzSubscription vs New-AzSubscriptionAlias

What is the best way now to create an Azure Subscription using PowerShell.

Can we use the command New-AzSubscription ? I see lot of articles on internet stating the command is broken . Is this issue fixed.

Now i think there are lot of commands to create new New-AzSubscriptionAlias. is this command in preview ?
https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/programmatically-create-subscription-enterprise-agreement?tabs=azure-powershell

But if i dont want to go for the PREVIEW ones, what is the best way to use GA command to create new subscription

windows-server-powershellazure-automation
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MSTechie-7364 - Did the below answer help resolve your issue.?

If so, Please "Accept as Answer" so it can be beneficial to the community.

0 Votes 0 ·

@MSTechie-7364 - Did the below answer help resolve your issue.?

If so, Please "Accept as Answer" so it can be beneficial to the community.

0 Votes 0 ·
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hello @MSTechie-7364

Most of scripts on the internet is possible that are not updated for azure changes in formats or syntaxes. There is a fresh publication from Microsoft on the matter that should work successfully:

you can find all details here: https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/programmatically-create-subscription-enterprise-agreement?tabs=rest

Hope this resolves your query,
Best regards,

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Monalla-MSFT avatar image
0 Votes"
Monalla-MSFT answered

@MSTechie-7364 - Thanks for reaching out.

As @LimitlessTechnology-2700 rightly said about the fresh publication from Microsoft.

To your point, There is no New-AzSubscription command that I'm aware of, the New-AzSubscriptionAlias command is in preview.

If you want to use PowerShell, youneed to use the `New-AzSubscriptionAlias` command.

See this article for more information: programmatically-create-subscription

Hope this helps.

If it does, Please feel free to "accept the answer" so it can be beneficial to the community.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.