Connect-AzureRmAccount Not Recognized

In this PowerShell Azure tutorial, we will discuss how to fix the error, The Term ‘Connect-AzureRmAccount’ is Not Recognized that comes while running the PowerShell command to connect to Microsoft Azure.

Connect-AzureRmAccount Not Recognized

Recently, while trying to connect to the AzureRmAccount, I got the error The Term ‘Connect-AzureRmAccount’ is Not Recognized. I was executing the below PowerShell cmdlet to connect to the AzureRmAccount.

PS C:\WINDOWS\system32> Connect-AzureRmAccount

After I had executed the above PowerShell cmdlet, I got this error.

The complete error message was as below

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

Now, let’s try to fix this error.

Connect-AzureRmAccount Not Recognized [Solution]

First, we are getting this error because we are trying to connect to Azure without installing the module on our machine. So, to fix this issue, you must install the AzureRm PowerShell module.

Pre-requisites for installing AzureRm PowerShell module

  • The first requirement is that .Net Framework version 4.7.2 or later should be installed on your machine.
  • Your PowerShell version must be 5.1 or later. You can use the PowerShell cmdlet $PSVersionTable.PSVersion to check the PowerShell Version. You will get the Output below.
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  546  
connect azurermaccount
  • The following requirement is you must have the NuGet package provider installed on your machine. You can use the Get-PackageProvider PowerShell cmdlet to check if the NuGet package provider is installed on your machine.

You will get the Output below

Name                     Version          DynamicOptions                              
----                     -------          --------------                              
msi                      3.0.0.0          AdditionalArguments                         
msu                      3.0.0.0                                                      
NuGet                    3.0.0.1          Destination, ExcludeVersion, Scope, SkipD...
PowerShellGet            1.0.0.1          PackageManagementProvider, Type, Scope, A...
Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemCom...

You can see it here

connect-azurermaccount

If you don’t have the NuGet package provider installed on your machine, then you can use the below PowerShell cmdlet to install the same

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force

Once you have all the above Prerequisites installed on your machine, you are ready to install the AzureRm PowerShell module in your system.

Install the Azure PowerShell AzureRM Module

The next step is using the below PowerShell cmdlet to install the Azure PowerShell AzureRM Module.

PS C:\WINDOWS\system32> Install-Module AzureRm

Once you run the above command, click the Yes to All button on the below window to install the Azure PowerShell AzureRM Module without any issues.

Connect-AzureRMAccount is not recognized

Once the Azure PowerShell AzureRM Module is installed successfully, you can run the below PowerShell cmdlet again to connect to the AzureRmAccount. Now, you should be able to connect to the AzureRmAccount without any issues.

PS C:\WINDOWS\system32> Connect-AzureRmAccount

You can see it here

add-azurermaccount

This is how you can fix the error “the term ‘Connect-AzureRMAccount’ is not recognized as the name of a cmdlet.”

You may also like the below Articles:

Wrapping Up

This article discussed how to fix the error “The Term ‘Connect-AzureRmAccount’ is Not Recognized.” I hope you have enjoyed this article and it helped you to fix your issue as well !!!.