Do you want to know how to connect Azure portal using PowerShell? Check out this complete tutorial, here, I have explained different ways to connect to Azure using PowerShell.
We can use Azure PowerShell commands to manage resources in Azure.
Connect to Azure using PowerShell
There are two ways to connect to Azure from PowerShell.
- By using the Install-Module AzureAD command
- By installing Azure PowerShell on your local machine
We can also use the Azure Cloud Shell to connect to Azure using PowerShell.
Install-Module AzureAD PowerShell Module
To connect to Azure AD using PowerShell, you need first to install the AzureAD PowerShell module.
Make sure to open the PowerShell in admin mode, for this, Type “PowerShell” in the start menu -> Right-click on Windows PowerShell and choose “Run as administrator”
Before installing, you can also check if you have installed it or not by running the below command.
Get-Module -ListavailableTo install AzureAD on your local machine, run the below command in Windows PowerShell. Below is the PowerShell command.
Install-Module AzureADOnce you run the command, this will install the Azure AD PowerShell module like the screenshot below:

To know what Azure PowerShell modules are installed, run the below command.
Get-InstalledModule
or
Get-Module -Listavailable
It is always good to install the latest version of Azure PowerShell, and you can run the below command to update the Azure PowerShell module.
Update-Module -Name AzureADConnect to AzureAD from PowerShell
Once you install the module, run the below PowerShell command to connect to Azure AD.
Connect-AzureADYou can also run the below command
Connect-AzureAD -Credential (Get-Credential)Once you run the above command, it will ask you for the username and password (Make sure the account has Azure AD administrator permission), and then it will connect to Azure AD.
Once you connect to Azure AD from PowerShell, you can check out a few examples below.
If you are not sure about the PowerShell commands available in Azure AD, run the below commands.
Get-Command -Module AzureADThis will list down all the AzureAD PowerShell cmdlets.
Here is an example, Get all users from the Azure AD using PowerShell by running the below command.
Connect-AzureAD
Get-AzADUserYou can see it will display all the users from the Azure active directory.

This is how to connect PowerShell to Azure.
Install Azure PowerShell
Another way to connect to Azure PowerShell is to install Azure PowerShell on Windows using an MSI installer.
To work with Azure PowerShell, you should have:
- Windows PowerShell 5.1 (Update Link)
- .NET Framework 4.7.2 or later. (Download Link)
Note: The PowerShell MSI installer works on having PowerShell versions 5.1 or higher. You can check the current PowerShell version by using the below command:
$PSVersionTable.PSVersionIf you are using the Widows, you will already have the PowerShell 5.1 version.

Now, you can download Azure PowerShell MSI package from GitHub.
Once downloaded, run the setup to install Microsoft Azure PowerShell. Click on Install like below:

Now, you can see on the screen it is installing Azure PowerShell.