3
votes

I am stuck in a problem in Azure PowerShell. I am not able to connect to AzureRM account. It's showing this error:

Connect-AzureRMAccount : The term 'Connect-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 + Connect-AzureRMAccount + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Connect-AzureRMAccount:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

I'm doing this in Mac OS . Firstly I've installed the PowerShell using: brew cask install PowerShell. Then I've done the following:

  1. Install-Module AzureRM -AllowClobber -Scope CurrentUser.
  2. Install-Module Azure.
  3. Install-Module AzureRM.
  4. Import-Module AzureRM.
  5. Connect-AzureRMAccount (It's Showing me the above Error).

I am expecting step 5 to give me the sign in pop up. Please Help

1
I had the same issue some time ago, I fixed it by installing the NuGet package before installing the AzureRM PS module, but it was a Windows 10 device, so can't confirm it would work on Mac.Pablo Alvarez
What's the output of get-command *azurerm* you can follow this to install PowerShell on mac, thatlazyadmin.com/2169-2Nancy Xiong
I have already tried the solution by the lazy admin .Not helpful! and get-command azurerm is giving 1978 outputs of commandsAmit Joshi
What does the NUGet Package does?Amit Joshi

1 Answers

9
votes

The AzureRM module isn't available on macOS. You will need the Az module. It has tons of parity and an option for enabling compatible aliases (Enable-AzureRmAlias): https://azure.microsoft.com/en-us/blog/azure-powershell-cross-platform-az-module-replacing-azurerm/

Keep in mind that this module is the future, in general (Windows, macOS, and Linux... as well in Azure Cloud Shell).

The following cmdlets are useful:

Install-Module -Name Az -AllowClobber
Import-Module Az
Connect-AzAccount