Login-AzureRmAccount returns a subscription, but Get-AzureSubscription returns empty

I can successfully login using Login-AzureRmAccount . I can also see my subscription in the return value of Login-AzureRmAccount. But after logging in, if I type Get-AzureSubscription , it will be empty.

Find below screenshot

enter image description here

+5
source share
2 answers

Well, you need to use Get-AzureRmSubscription (RM), since you are using the cmdlet for ASM mode, not ARM.

There are two deployment modes in Azure, ASM (old) and ARM (new).

+16
source

Extension of other answers.

Azure has two deployment models. Azure Service Management (ASM) and Azure Resource Manager (ARM).

To interact with anything in ASM, you use the Azure Module, for example:

Add-AzureAccount Login to ASM

Select-AzureSubscription Select the subscription that you assign to work in

Get-AzureSubscriptions Shows all subscriptions.

To interact with anything in ARM, you use AzureRM modules, for example:

Add-AzureRmAccount Login to ARM

Select-AzureRmSubscription Selects the ARM subscription that you allocate to work in

Login-AzureRmAccount Logs in ARM Also

ARM PowerShell Review

ASM PowerShell Overview

+4
source

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


All Articles