This post is to simplify things on getting Azure classic VM report in a nice format. We wrote PowerShell script to collect azure VM information in HTML format. 

You can download the script from here:!158&authkey=!AE-BWeCcsiGHwvo&ithint=file%2cps1 

 Make sure you have Azure PowerShell module installed.

1. To check the module

2. Login to Azure classic subscription.

You will be shown login windows. Provide your credentials

You will see your Azure subscription ID and tenants ID.

3. Select-AzureSubscription -SubscriptionName 'your sub. name.

   4. Before extracting VM report you will have to know the name of your cloud service. Check your cloud service you want to take VM report from.

5. CCreate folder structure “C:\temp\Reports\Azure_VM_Info” in this location where you will save your report.

6. Change your cloud service name and run your PowerShell command to get the nice report.

$cloudsname = 'Your azure cloud service name'
$getvm = Get-AzureVM -ServiceName $cloudsname | select -Property Name,IpAddress,InstanceSize,Status | ConvertTo-Html -Fragment
$getvm = $getvm | foreach {
      $_ -replace "<td>ReadyRole</td>","<td style='color:green'>Running</td>"
$getvm = $getvm | foreach {
      $_ -replace "<td>StoppedDeallocated</td>","<td style='color:red'>Stopped</td>"
$date = Get-Date -UFormat "%m-%d-%y"
$filename = "AzureVM_Info"+"$date"
$HTML = ConvertTo-Html -Body "<H2> AzureVMInfo - </H2>", "$getvm" -Head "<style> body {background-color: lightblue; } table {background-color: white; margin 5px; float: left; top: 0px; display: inline-block; padding: 5px; border: 1px solid black} tr:nth-child(odd) {background-color: lightgray} </style>"
$HTML | Out-File C:\temp\Reports\Azure_VM_Info\$filename.html
Invoke-Item C:\temp\Reports\Azure_VM_Info\$filename.html

Hope this post will be informative to you.

Download Link

You can download the script from here:

Get-Module -ListAvailable

You should be able to see Azure module
ModuleType Version    Name                                ExportedCommands                                                                                                                                  
---------- -------    ----                                ----------------                                                                                                                                  
Manifest   1.2.3      Azure                               {Disable-AzureServiceProjectRemoteDesktop, Enable-AzureServiceProjectRemoteDesktop, Get-AzureServiceProjectRoleRuntime, Save-AzureServiceProject...

2. Login to Azure classic subscription.