3
votes

I am setting azure subscription in powershell with "Set-AzureSubscription –DefaultSubscription $SubscriptionID" API.

But it is giving me error as "Set-AzureSubscription : A parameter cannot be found that matches parameter name 'DefaultSubscription'."

Please guide me on if there is change in azure powershell API's.

2

2 Answers

5
votes

Yes, there was a change in the PowerShell APIs in a recent update. The Select-AzureSubscription now has the parameter to set the default. The name of that parameter is -Default (instead of -DefaultSubscription).

3
votes

As of version 0.7.2, you need to call Select-AzureSubscription with the subscription name, like this:

Select-AzureSubscription -SubscriptionName "mySubscriptionName"

You can check what version of Azure cmdlets you have by running this command:

get-module azure

Which returns a result like this:

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 0.7.2 Azure {Add-AzureAccount, Add-AzureCacheWorkerRole, Add-AzureCertificate, Add-AzureDataDisk...}