Microsoft Azure · Windows Powershell

Connect to Microsoft Azure Subscription using Windows PowerShell – Part 2

In my previous blog we learnt to connect to Azure subscription by importing azure license setting file. In this blog we will learn an easier method of connecting to azure subscription using Add account method using windows PowerShell.

  1. First step is to open the windows PowerShell window.
  2. Type the command Add-AzureAccount. Press Enter key.

A window gets pop up asking you to enter your Microsoft credential to login to azure portal.


3. It will check the credentials that you entered and shows the account name after successfully connected.


Now we are connected to our Azure Subscription.

4. Let’s check the details about Azure Subscription



We will get the same output as we get when we connect to azure using license setting method telling the details of azure subscription like subscription id, subscription name, default account, etc.

5. Similarly we can also check the details about the virtual machines we have in our subscription.


See it list out all the virtual machines associated to current azure subscription.


6. Once we finished, we can remove the azure account.

Remove-AzureAccount –Name ‘AccountName’


It will disconnect you from azure portal and makes PowerShell forgot about the subscription that you were connected.

So, this is the second method we learnt today to connect to our azure subscription using AddAcount method from Windows PowerShell.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s