Skip to main content Link Menu Expand (external link) Document Search Copy Copied
Table of contents
  1. Resources
  2. Remove AzureRM powershell module
  3. Install Az Module
  4. Check usage
  5. Configuration
    1. Persistent login

Resources

Remove AzureRM powershell module

  • AzureRM and Az modules installed for PowerShell 5.1 on Windows at the same time is not supported
  • Ensure that all powershell windows (vscode included) are closed before uninstall
# Uninstall the old azureRM powershell
Uninstall-AzureRm

Install Az Module

# Install the new module
Install-Module -Name Az -AllowClobber
Get-InstalledModule -Name Az -AllVersions | select Name,Version
Get-InstalledModule | ? {$_.Name -like 'Az*'} | select Name,Version

Install-Module -Name powershell-yaml

Check usage

# Connect to Azure with a browser sign in token
Connect-AzAccount
Get-AzSubscription

Configuration

Persistent login

  • Informations are stored in $env:USERPROFILE.Azure or $HOME/.Azure
# Enable context persistence
Enable-AzContextAutosave
# Connect to Azure with a browser sign in token
Connect-AzAccount

# To Disable
# Disable-AzContextAutosave