Get-AzureVM returns nothing - tried sentences

For some reason, I don't get any information when I run Get-AzureVM or Get-AzureRmVm .

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

I am using the latest version of Azure Powershell. I used the Resource Manager to create my virtual machines a couple of days ago.

+5
source share
2 answers

If you have several Azure signatures under your Azure account, you first need to select the correct subscription that contains your Azure Resource Manager (RM) virtual machine with the following command.

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

You can see a list of subscription IDs and tenant IDs:

 Get-AzureRmSubscription 

After you set the correct Azure Rm context, you can get all the Azure RM virtual machines in the context of the current subscription:

 Get-AzureRmVM 

This solution was tested on my Azure and VM subscription using the latest version of Azure PowerShell December 2015 (1.0.2).

Hope this helps!

+6
source

if you choose a development model, this is a resource manager instead of Classic when creating a virtual machine, you should use the command below to list virtual machines:

 Get-AzureRmVM 
0
source

Source: https://habr.com/ru/post/1238673/


All Articles