MoonHorse
MoonHorse

Reputation: 2479

How to find the Azure image size?

In Azure, i have created an image from a VM as below. enter image description here I want to check the image size but i cannot find it from the portal. Also i have checked Az Powershell and az cli, but i didn't see any commands giving me its size. Is there a way to get this info?

Upvotes: 2

Views: 2265

Answers (1)

Paolo
Paolo

Reputation: 26074

You can use:

$resourceId = "" # The resource ID of your image
$i=Get-AzureRmResource -ResourceId $resourceId
$diskSize = $i.Properties.storageProfile.osDisk.diskSizeGB

Upvotes: 4

Related Questions