First check if the below “azure-cli.list” is created already by running below command:
ls /etc/apt/sources.list.d
┌──(kali㉿kali)-[/]
└─$ ls /etc/apt/sources.list.d
azure-cli.sources google-chrome.list.save sublime-text.list.save
google-chrome.list sublime-text.list vscode.list
The output could look like above, since we don’t have the file we need to create it by using below command:
sudo nano /etc/apt/sources.list.d/azure-cli.list
now we need to find the latest deb stable distro for Azure-CLI, we are using “bookworm” for now, you can use below to paste in the file:
deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/repos/azure-cli/ bookworm main
once pasted, press CTRL+O to write the file, press ENTER and then CTRL+X to exit the file.
You can run below command to confirm that the file is written properly.
cat /etc/apt/sources.list.d/azure-cli.list
Run following commands to install the Azure-CLI:
sudo apt-get update
above command will fetch the information about packages
sudo apt-get install azure-cli
This will install the Azure-cli and now run following command to check if Azure-cli is installed properly and it should display the version of the Azure-cli installed.
az --version


Leave a Reply