5

Running PowerShell ISE (V4), I install the AzureRM module as follows

Import-Module AzureRM

I then check the version

(get-module azurerm).Version

which returns

Major  Minor  Build  Revision
3      4      0      -1

I then attempt to use the login cmdlet

Login-AzureRmAccount

but get the error

Login-AzureRmAccount : The term 'Login-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Login-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Login-AzureRmAccount:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

What am I doing wrong?

NOTE I'm working behind a proxy and have used the following command to get round it

[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials

I've also set the PSGallery repo as follows

Register-PSRepository -Name "PSGallery" -SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted
8
  • try reinstalling the whole module?
    – 4c74356b41
    Feb 7, 2017 at 12:20
  • Now when attempting Install-Module AzureRm I get the error No match was found for the specified search criteria and module name AzureRm. Similar to this. Will try installing PowerShellGet again.
    – James B
    Feb 7, 2017 at 12:46
  • Nope. Windows 8.1. I am working behind a proxy - not sure if this is causing the error in my previous comment. Weird though coz I can list all the Azure modules, just can't seem to use them.
    – James B
    Feb 7, 2017 at 13:02
  • What do you get from this: Get-Module -ListAvailable -Name Azure -Refresh
    – juvchan
    Feb 7, 2017 at 13:08
  • @juvchan: Nothing shown when I use that command. But I do get quite a long list if I use Get-Module -ListAvailable -Name Azure* -Refresh. Do I need to Install-Module Azure as well as Install-Module AzureRM? I thought former was just for ASM.
    – James B
    Feb 7, 2017 at 13:17

2 Answers 2

2

I upgraded to Windows Management Framework 5 and I can now run the command Login-AzureRMAccount

Also we can download the Azure PowerShell installation file and install it. We can download the PS version 3.3.0 installation file from this page:

https://github.com/Azure/azure-powershell/releases/tag/v3.3.0-December2016

1
  • Just checking in to see if the information provided was helpful. Please let me know if you would like further assistance.
    – Jason Ye
    Feb 9, 2017 at 1:48
1

Login-AzureRmAccount is simply an alias for Add-AzureRmAccount which is used to access the ARM resources in your Azure account.

Add-AzureAccount is used to access the "classic" resources in your Azure account.

8
  • So Add-AzureAccount appears to work - window opens for me to add credentials etc. Running Get-AzureAccount shows me my account. However, trying to use a command like New-AzureRmResourceGroup ... just errors telling me to Run Login-AzureRmAccount - when I try and do that I get the same error as before, i.e., .. is not recognized as the name of a cmdlet....
    – James B
    Feb 7, 2017 at 14:29
  • Are you able to run Add-AzureRmAccount? You cannot run New-AzureRmResoucegroup because you are only logged in to access classic resources (Add-AzureAccount).
    – schruberg
    Feb 7, 2017 at 14:44
  • Makes sense, but still stuck with my quandry - can't use Login-AzureRmAccount as it's not recognised, apparently.
    – James B
    Feb 7, 2017 at 14:49
  • 1
    Did you run both Install-Module AzureRM and Install-AzureRm?
    – schruberg
    Feb 7, 2017 at 14:54
  • 1
    The first command installs the AzureRM module from the PowerShell Gallery. The second command installs all the component modules of Azure Resource Manager in the module version range specified in the AzureRM module. Link:learn.microsoft.com/en-us/powershell/resourcemanager
    – schruberg
    Feb 7, 2017 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.