No default subscription assigned. Use Select-AzureSubscription -Default <subscription_name> to set a default subscription

When trying to run Start-AzureService Im continues to receive the above error.

The following information is requested when running Get-AzureAccount:

 Id Type Subscriptions Tenants -- ---- ------------- ------- [email protected] User 12345678-1234-5678-9012-345678901235 {12345678-1234-5678-9012-345678901235} 

And the following information requested when executing Get-AzureSubscription:

 SubscriptionId : 12345678-1234-5678-9012-345678901235 SubscriptionName : My Production (Pay-As-You-Go) Environment : MyCloud DefaultAccount : [email protected] IsDefault : True IsCurrent : True TenantId : 12345678-1234-5678-9012-345678901235 CurrentStorageAccountName : Select-AzureSubscription : Parameter set cannot be resolved using the specified named parameters. 

is requested when, when I try to execute the suggested command:

 Select-AzureSubscription -Default "My Production (Pay-As-You-Go)" 
+6
source share
2 answers

Use this option to select your default subscription:

 Select-AzureSubscription -Default -SubscriptionName "My Production (Pay-As-You-Go)" 

You can also use -SubscriptionId (and GUID) instead of a name.

For more information about the Select-AzureSubscription ; type Get-Help Select-AzureSubscription .

If this does not work, try first before choosing your subscription:

  Add-AzureAccount 

Update if you are still encountering a problem:

If you are using AzureRM / with old cmdlets (or just AzureRM) and still run into problems, I highly recommend that you check if you have multiple versions of the AzureRM.Profile module. I came across this many times when one version is installed in Program Files and another under my user profile (or somewhere else in PSModulePath).

To find out which modules / versions are installed:

 Get-Module AzureRm.Profile -ListAvailable 

If you have multiple instances and versions of this, this may create some problems with some of your cmdlets.

+11
source

When I tried Select-AzureSubscription , it gave me the "Subscription does not exist" error when I was passing the 100% correct subscription name or subscription identifier that I found on the Azure portal and from powershell:

 $account = Login-AzureRmAccount $account.Context.Subscription.SubscriptionId $account.Context.Subscription.SubscriptionName 

Adding an Azure account fixed the issue for me:

 Add-AzureAccount 
+2
source

All Articles