The Term ‘Connect-AzureRmAccount’ is 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.

The Term ‘Connect-AzureRmAccount’ is Not Recognized

Recently, while I was 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 have executed the above PowerShell cmdlet, I got the error “The term ‘Connect-AzureRMAccount’ is not recognized as the name of a cmdlet”.

The exact 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.

The Term ‘Connect-AzureRmAccount’ is Not Recognized [Solution]

The first thing is, we are getting this error because we are trying to connect to Azure without having the module installed 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  .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 like below
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  546  
‘Connect-AzureRmAccount’ is Not Recognized
  • The next 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’ Not Found

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

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

Install the Azure PowerShell AzureRM Module

Now the next step is, to use the below PowerShell cmdlet to install the Azure PowerShell AzureRM Module.

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

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

Connect-AzureRMAccount is not recognized

Once the Azure PowerShell AzureRM Module will get 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 issue.

PS C:\WINDOWS\system32> Connect-AzureRmAccount

You can see it here

Connect-AzureRMAccount not working

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

You may also like following the below Articles:

Wrapping Up

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