Install Azure PowerShell on Ubuntu/Linux — Ulitmate Guide
1 min readAug 22, 2022
Step-1 Install Power Shell on Linux:-
# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https software-properties-common
# Download the Microsoft repository GPG keys
wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Update the list of packages after we added packages.microsoft.com
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
Step-2 Start Power Shell :-
pwsh
Step-3 Install Azure CLI in power shell :-
Install-Module -Name Az -AllowClobber
Step -4 Update Azure CLI:-
Update-Module -Name Az
Step-5 Import Az module to use azure cli commands:-
Import-Module Az
Step-6 Connect You Azure Account:-
Connect-AzAccount
Step-7 Run Any command:-
# this command will show all resources in your account
Get-AzResource