Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find the name of the VM image used to create an Azure VM using PowerShell?

If I use Get-AzureVM (PowerShell cmdlet) to fetch a running VM then the fields I get back are

DeploymentName
Name
Label
VM
InstanceStatus
IpAddress
InstanceStateDetails
PowerState
InstanceErrorCode
InstanceFaultDomain
InstanceName
InstanceUpgradeDomain
InstanceSize
HostName
AvailabilitySetName
DNSName
Status
GuestAgentStatus
ResourceExtensionStatusList
PublicIPAddress
PublicIPName
PublicIPDomainNameLabel
PublicIPFqdns
NetworkInterfaces
VirtualNetworkName
ServiceName
OperationDescription
OperationId
OperationStatus

However I cannot see the name of the image used to create the VM. I can see this information using the Azure portal (under Settings > Properties > SOURCE IMAGE NAME). How can I get the source image name using PowerShell?

like image 240
Oliver Bock Avatar asked Sep 07 '15 04:09

Oliver Bock


1 Answers

If you want to check the source image without using cmd/Powershell, then follow these steps: How to find the running VM image version.

> Go to azure portal
> Select the running/stopped VM whose image you want to identify
> Go to export template option
> On the right side of the screen, you will see the template window will open in JSON format.
> Ctrl+F (search) > imageReference > you will get your image version in the template.
like image 137
thecloudguy Avatar answered Sep 22 '22 17:09

thecloudguy