Azure Fix: No default subscription has been designated

One day if you get this error:

[ERROR] Get-AzureSubscription : No default subscription has been designated. Use Select-AzureSubscription -Default to set the default subscription.

It means like always you must pay ! If like me you already have one but not recognized follow the next step, but you must ensure before that your subscription is active (even a free trial one).

AzureSubscription

Then execute the following PowerShell knowing your “Subscription name” string. There is a cool button there to copy it (next to the name).

Select-AzureSubscription -SubscriptionName "Visual Studio Premium avec MSDN" -Default

For me it doesn’t worked, i got a message saying that the subscription doesn’t exists, so i use a solution found on Stackoverflow.
Relaunch your association process with current valid Azure account.

Add-AzureAccount 
Id              Type Subscriptions                                                              Tenants                               
--              ---- -------------                                                              -------                               
jean@xxxx.fr User 3f7cb992-1715-4df0-b900-cea5f35dd708...                                    {d68dec8d-f2fb-4809-b92d-1f2e79d592e5}

Then try it again

Get-AzureSubscription -SubscriptionName "Visual Studio Premium avec MSDN"

SubscriptionId : 3f7cb992-1715-4df0-b900-cea5f35dd708
SubscriptionName : Visual Studio Premium avec MSDN
Environment : AzureCloud
DefaultAccount : jean@xxxx.fr
IsDefault : True
IsCurrent : True
TenantId : d68dec8d-f2fb-4809-b92d-1f2e79d592e5
CurrentStorageAccountName :

Et voilà

1 thought on “Azure Fix: No default subscription has been designated”

Leave a comment