Azure PowerShell: things have changed

… but of course you don’t get told in anything in-your-face. To wit, this command…

AzureCli19.PNG

… used to return stuff.. and now returns the blank line you see. Turns out this is because Get-AzureVM now refers to the “Classic” variants in the Azure Portal. If you created through the (implicitly recommended) Resource Manager in the Azure Portal, then you now have to use this command:

AzureCli20.PNG

, where the [Rm] part stands for [Resource Manager] . This is a reasonable link.

So that took a while to get there. Next: I have 2 subscriptions. Although I could use this to enumerate my subscriptions, with [123] being my default subscription:

AzureCli21.PNG

, it a LONG time to work out that a) you can only work in one subscription context at a time, and that resources not in the default subscription will not be listed until you do this:

AzureCli22.PNG

With that context set, it will now happily list e.g. the VMs I created on my non-default subscription:

AzureCli20.PNG

And a general MSDN link around those Azure RM cmdlets:

https://msdn.microsoft.com/en-us/library/mt619263.aspx

https://msdn.microsoft.com/en-us/library/mt603718.aspx

And just throwing in some of the keywords/cmdlets I used on the way:

  1. Import-Module -Name PowerShellGet 
  2. Install-Module AzureRM
  3. Install-Module Azure -AllowClobber
  4. Import-Module AzureRM
  5. Get-AzureAccount
  6. Get-AzureVM
  7. Get-AzureRmVM
  8.  Login-AzureRmAccount
  9. Add-AzureRmAccount
  10. Get-AzureRmSubscription

 

By the way, June 22 2016 (that is, just 2 weeks ago) seems a date when a lot changed in PowerShell for Azure. And even the updated docs still talk about “this is early documentation, subject to change, etc…”

Hm, and now I’ve just spotted the “true” CLI ( as opposed to PowerShell):

https://azure.microsoft.com/en-gb/documentation/articles/xplat-cli-install/

Another time. Night.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s