New-UDPage -Url "/AzureVmSizeHelper" -Name "AzureVmSizeHelper" -Content {
$tenantId = '2dea0464-da51-4a88-bae2-b3db94bc0c54'
$AppId = '60244573-7130-4026-9c6d-47de73f8ca29'
$SecureStringPwd = $Secret:azure_iaasserviceprincipal
$PSCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $AppId, ($SecureStringPwd | ConvertTo-SecureString -AsPlainText -Force)
Connect-AzAccount -ServicePrincipal -Credential $PSCredential -Tenant $tenantId

$TableData = Get-AzVmSize -Location centralus | Select *,`
    @{n='MemoryInGB';e={$_.MemoryInMb / 1024}}, `
    @{n='OSDiskSizeInGB'; e={$_.OsDiskSizeInMb / 1024}}, `
    @{n='ResourceDiskSizeInGB'; e={$_.ResourceDiskSizeInMB / 1024}} | Sort-Object NumberOfCores,MemoryInGB

New-UDTable -Columns @(
    New-UDTableColumn -Property 'Name' -Title 'Name' -ShowSort -ShowFilter
    New-UDTableColumn -Property 'NumberOfCores' -Title 'NumberOfCores' -ShowSort -ShowFilter
    New-UDTableColumn -Property 'MemoryInGB' -Title 'MemoryInGB' -ShowFilter -ShowSort
    New-UDTableColumn -Property 'OSDiskSizeInGB' -Title 'OSDiskSizeInGB' -ShowFilter -ShowSort
    New-UDTableColumn -Property 'ResourceDiskSizeInGB' -Title 'ResourceDiskSizeInGB' -ShowFilter -ShowSort
) -Data $TableData -Dense
} -Title "AzureVmSizeHelper" -Icon @{
		type = 'icon'
		id = 'f45c0541-5f78-4c00-899b-548e1bbabb04'
	}