Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get-AzureVM Returns Nothing - Tried suggestions

For some reason I do not get any information when I run Get-AzureVM or Get-AzureRmVm.

I used the following to login: Login-AzureRMAccount. I can see all of my subscriptions by doing Get-AzureSubscription | select SubscriptionName.

I am running latest version of Azure Powershell. I used Resource Manager to build my virtual machines a couple of days ago.

like image 753
Rollersloft Avatar asked Dec 18 '15 21:12

Rollersloft


1 Answers

If you have multiple Azure subscriptions under your Azure account, you will first need to select the right subscription where your Azure Resource Manager (RM) VM resides by the following command.

Set-AzureRmContext -SubscriptionId <your-subscriptionId> -TenantId <your-tenantId>

You could see your list of subscription Ids and tenant Ids by:

Get-AzureRmSubscription 

After you set the right Azure Rm Context, you should be able to get all Azure RM VM under the current subscription context by:

Get-AzureRmVM

This solution has been tested on my Azure subscription and VM using the latest Azure PowerShell December 2015 (1.0.2).

Hope this helps!

like image 139
juvchan Avatar answered Nov 06 '22 15:11

juvchan