David Andersson
David Andersson

Reputation: 55

Azure PowerShell alias

I see many answers to questions about Azure where the answer is you have to execute a series of commands like these:

azure vm image list-publishers westus
azure vm image list-offers westus MicrosoftWindowsServer 
azure vm image list-skus westus MicrosoftWindowsServer WindowsServer 

from Service Fabric Application vmImageSku

This is just one random example out of many.

How do you translate statements like that into command that works?

I feel I am missing some step in my configuration of my environment. I have just started a normal powershell console and are working in that. I have not imported anything azure specific into the console but have Visual Studio 2017 and latest azure sdk installed on the box.

Upvotes: 0

Views: 183

Answers (2)

Jason Ye
Jason Ye

Reputation: 13974

Those commands are not Azure PowerShell commands. As Martin said, to run those commands, you should install CLI 1.0. We can use Azure PowerShell commands to get those information:

azure vm image list-publishers westus

Get-AzureRmVMImagePublisher -Location westus

azure vm image list-offers westus MicrosoftWindowsServer

Get-AzureRmVMImageOffer -Location westus -PublisherName MicrosoftWindowsServer

azure vm image list-skus westus MicrosoftWindowsServer WindowsServer

Get-AzureRmVMImageSku -Location westus -PublisherName MicrosoftWindowsServer -Offer WindowsServer

Upvotes: 2

Martin Brandl
Martin Brandl

Reputation: 59001

You have to install the azure cli:

Note that there is already a version 2 of the CLI which uses the az keyword which you might prefer.

Upvotes: 0

Related Questions