How to get public IP of Azure VM using CLI?
You can just use the CLI command az vm show -d -g resourceGroupName -n vmName --query publicIps -o tsv to output the public IP.
How do I get a list of VMs in Azure?
Get-AzVM. The Get-AzVM command is used to get the lists of Virtual machines or the properties of the Azure Virtual Machines present under your Azure subscription.