Figuring out Image version number of Virtual machine

sns 9,226 Reputation points
2023-12-04T18:52:21.4666667+00:00

I created a VM from one of the custom image from particular version

But I want to know which image version i have used to create VM. is it possible ? if yes how?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,547 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 83,711 Reputation points
    2023-12-04T20:31:25.47+00:00

    Hi,

    You can use powershell code similar to below:

    $vm = Get-AzVM -ResourceGroupName myResourceGroup -Name myVM 
    $vm.StorageProfile.ImageReference|fl
    
    

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Dillon Silzer 56,206 Reputation points
    2023-12-04T22:21:53.8466667+00:00

    Hi sns,

    Another solution is running the following PS command:

    (Get-AzureVM -ServiceName serviceName -Name vmName).VM.OSVirtualHardDisk.SourceImageName
    

    Cited from https://stackoverflow.com/questions/32431186/how-can-i-find-the-name-of-the-vm-image-used-to-create-an-azure-vm-using-powersh


    If this is helpful please accept answer.

    0 comments No comments