4

Im new to windows azure, Ive looked to this documentation, to me it works, Listing Images on gallery. https://management.core.windows.net/subscription-id/services/images

But this isnt what Im looking for, Is there a way to list the My Images on my account and not the images on gallery.

David Makogon
  • 69,407
  • 21
  • 141
  • 189
Villapando Cedric
  • 289
  • 1
  • 4
  • 14

3 Answers3

9

If you run the PowerShell cmdlet Get-AzureVMImage, you'll see all images. As stated by @Gaurav, The ones that correlate to My Images have a PublisherName of User. So, again, using PowerShell, here's how to see just your images by piping to Where-Object:

Get-AzureVMImage | Where-Object { $_.PublisherName -eq 'User' }

If you wanted to see the image names in your console, you could pipe it to ForEach-Object:

Get-AzureVMImage | Where-Object { $_.PublisherName -eq 'User' } |
ForEach-Object { Write-Host $_.ImageName }

Note: If your image's PublisherName is empty, use Category -eq 'User' instead.

Here's sample output, from my subscription:

Output of 'My Images'

EDIT If you're using the Mac/Linux CLI, you'd run a slightly different command:

azure vm image list

Or, to return json:

azure vm image list --json

Once you have json, you could, for example, pipe to a command line tool such as jsontool to get your own image names (the image name is returned in the Name key):

azure vm image list --json | json -a -c 'this.Category == "User"' Name
Thinkable
  • 301
  • 2
  • 7
David Makogon
  • 69,407
  • 21
  • 141
  • 189
1

You would still use the same operation. The operation returns both system defined (i.e. gallery) and user defined images. To see only the user defined images, you would need to filter on PublisherName which would be User for user defined images. This is what the documentation states:

PublisherName: The name of the publisher of the image. All user images have a publisher name of User.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
0

Try the below command. It works with Category as User rather than publisher name.

Solution:

Get-AzureVMImage | Where-Object { $_.Category -match 'User'} | 
ForEach-Object { Write-Host $_.ImageName }
patrick
  • 4,455
  • 6
  • 44
  • 61