In this short video we explain and demonstrate how to connect PowerShell to AzureAD AzureRM & AzureCLI:

How to Connect to AzureAD?

  1. Launch a PowerShell as an administrator
  2. Make sure you are running PowerShell 5.0 or newer:
    • $PSVersionTable.PSVersion
  3. Install the required module:
    • Install-Module MSOnline
  4. Sign into Azure:
    1. Connect-MsolService
  5. Run your commands:
    • Get-Command -Module MSOnlinehow to sign into AzureAD

How to Connect to AzureRM (aka. Azure Resource Manager – ARM)?

  1. Launch a PowerShell as an administrator
  2. Make sure you are running PowerShell 5.0 or newer:
    • $PSVersionTable.PSVersion
  3. Install the Azure Resource Manager module:
    • Install-Module AzureRM
  4. Activate the Azure Resource Manager module:
    • Import-Module AzureRM</li>
  5. Sign into Azure:
    • Connect-AzureRmAccount
  6. Run your commands:
    • Get-AzureRmTenant

how to sign into AzureRM

How to Connect to AzureCLI (aka. Azure Command Line Interface)?

  1. Launch a PowerShell as an administrator
  2. Make sure you are running PowerShell 5.0 or newer:
    • $PSVersionTable.PSVersion
  3. Install Azure CLI software (only needs to be done once per machine you are working on)
    • Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi
  4. Sign into Azure:
    • az login
  5. Run your commands:
    • az extension list-available --output table

how to sign into AzureCLI


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *